diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-30 13:57:43 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-30 13:57:43 -0600 |
commit | d74b988f7586ce648be6860a21b22ff5370fb597 (patch) | |
tree | d92cc688df5e6fb924d317c25a61f214378b061c /ui/src/main/java/com/wireguard/android/model | |
parent | 10e910186e1ae7f4b5336f0a5e81f0a2e411e61f (diff) |
global: cleanup code style
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/model')
3 files changed, 5 insertions, 2 deletions
diff --git a/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt b/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt index d5645e61..bb462b27 100644 --- a/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt +++ b/ui/src/main/java/com/wireguard/android/model/ObservableTunnel.kt @@ -9,9 +9,9 @@ import androidx.databinding.Bindable import com.wireguard.android.BR import com.wireguard.android.backend.Statistics import com.wireguard.android.backend.Tunnel +import com.wireguard.android.databinding.Keyed import com.wireguard.android.util.ExceptionLoggers import com.wireguard.config.Config -import com.wireguard.android.databinding.Keyed import java9.util.concurrent.CompletableFuture import java9.util.concurrent.CompletionStage diff --git a/ui/src/main/java/com/wireguard/android/model/TunnelComparator.kt b/ui/src/main/java/com/wireguard/android/model/TunnelComparator.kt index 96e69c58..9fb96cab 100644 --- a/ui/src/main/java/com/wireguard/android/model/TunnelComparator.kt +++ b/ui/src/main/java/com/wireguard/android/model/TunnelComparator.kt @@ -25,7 +25,9 @@ object TunnelComparator : Comparator<String> { return 0 } } + val tokens: MutableList<NaturalSortToken> = ArrayList() + init { for (s in NATURAL_SORT_DIGIT_FINDER.findAll(originalString.split(WHITESPACE_FINDER).joinToString(" ").toLowerCase(Locale.ENGLISH))) { try { @@ -36,6 +38,7 @@ object TunnelComparator : Comparator<String> { } } } + private companion object { private val NATURAL_SORT_DIGIT_FINDER = Regex("""\d+|\D+""") private val WHITESPACE_FINDER = Regex("""\s""") diff --git a/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt b/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt index 7d3a5e37..5091ed3b 100644 --- a/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt +++ b/ui/src/main/java/com/wireguard/android/model/TunnelManager.kt @@ -21,8 +21,8 @@ import com.wireguard.android.R import com.wireguard.android.backend.Statistics import com.wireguard.android.backend.Tunnel import com.wireguard.android.configStore.ConfigStore -import com.wireguard.android.util.ExceptionLoggers import com.wireguard.android.databinding.ObservableSortedKeyedArrayList +import com.wireguard.android.util.ExceptionLoggers import com.wireguard.config.Config import java9.util.concurrent.CompletableFuture import java9.util.concurrent.CompletionStage |