Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuasselDroid-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
QuasselDroid-ng
Commits
a48008d5
There was a problem fetching the pipeline summary.
Verified
Commit
a48008d5
authored
7 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Improve performance and clarity of hostmask splitter
parent
bb25a14c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/src/main/java/de/kuschku/libquassel/util/irc/HostmaskHelper.kt
+7
-12
7 additions, 12 deletions
...ain/java/de/kuschku/libquassel/util/irc/HostmaskHelper.kt
with
7 additions
and
12 deletions
lib/src/main/java/de/kuschku/libquassel/util/irc/HostmaskHelper.kt
+
7
−
12
View file @
a48008d5
...
@@ -20,20 +20,15 @@
...
@@ -20,20 +20,15 @@
package
de.kuschku.libquassel.util.irc
package
de.kuschku.libquassel.util.irc
object
HostmaskHelper
{
object
HostmaskHelper
{
fun
nick
(
mask
:
String
):
String
{
fun
nick
(
mask
:
String
)
=
mask
val
(
nick
,
_
,
_
)
=
split
(
mask
)
.
substringBefore
(
'!'
,
missingDelimiterValue
=
mask
)
return
nick
}
fun
user
(
mask
:
String
):
String
{
fun
user
(
mask
:
String
)
=
mask
val
(
_
,
user
,
_
)
=
split
(
mask
)
.
substringBeforeLast
(
'@'
,
missingDelimiterValue
=
mask
)
return
user
.
substringAfter
(
'!'
,
missingDelimiterValue
=
""
)
}
fun
host
(
mask
:
String
):
String
{
fun
host
(
mask
:
String
)
=
mask
val
(
_
,
_
,
host
)
=
split
(
mask
)
.
substringAfterLast
(
'@'
,
missingDelimiterValue
=
""
)
return
host
}
fun
split
(
mask
:
String
):
Triple
<
String
,
String
,
String
>
{
fun
split
(
mask
:
String
):
Triple
<
String
,
String
,
String
>
{
val
userPartHostSplit
=
mask
.
split
(
"@"
,
limit
=
2
)
val
userPartHostSplit
=
mask
.
split
(
"@"
,
limit
=
2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment