diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt index 57c7ca1..da064f0 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/subnets/SubnetInfo.kt | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon | 2 | * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon |
3 | * Copyright (C) 2017-2018 Pacien TRAN-GIRARD | 3 | * Copyright (C) 2017-2020 Pacien TRAN-GIRARD |
4 | * | 4 | * |
5 | * This program is free software: you can redistribute it and/or modify | 5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -30,7 +30,7 @@ data class SubnetInfo(val ipRange: String, val owner: String) { | |||
30 | private val SUBNET_DUMP_PATTERN by lazy { Pattern.compile(SUBNET_DUMP_PATTERN_STRING) } | 30 | private val SUBNET_DUMP_PATTERN by lazy { Pattern.compile(SUBNET_DUMP_PATTERN_STRING) } |
31 | 31 | ||
32 | fun ofSubnetDump(line: String) = ofSubnetDump(SUBNET_DUMP_PATTERN.matcher(line).apply { find() }) | 32 | fun ofSubnetDump(line: String) = ofSubnetDump(SUBNET_DUMP_PATTERN.matcher(line).apply { find() }) |
33 | private fun ofSubnetDump(matcher: Matcher) = SubnetInfo(ipRange = matcher[1], owner = matcher[2]) | 33 | private fun ofSubnetDump(matcher: Matcher) = SubnetInfo(ipRange = matcher[1]!!, owner = matcher[2]!!) |
34 | private operator fun Matcher.get(index: Int) = group(index) | 34 | private operator fun Matcher.get(index: Int) = group(index) |
35 | } | 35 | } |
36 | } | 36 | } |