Use MutableEntry correctly
This commit is contained in:
@@ -64,10 +64,9 @@ class TetheringService : IpNeighbourMonitoringService() {
|
|||||||
val disableIpv6 = app.pref.getBoolean("service.disableIpv6", true)
|
val disableIpv6 = app.pref.getBoolean("service.disableIpv6", true)
|
||||||
val iterator = routings.iterator()
|
val iterator = routings.iterator()
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
val (downstream, value) = iterator.next()
|
val entry = iterator.next()
|
||||||
if (value != null) continue
|
if (entry.value == null) try {
|
||||||
try {
|
entry.setValue(Routing(this, entry.key).apply {
|
||||||
routings[downstream] = Routing(this, downstream).apply {
|
|
||||||
try {
|
try {
|
||||||
forward()
|
forward()
|
||||||
masquerade(Routing.masquerade)
|
masquerade(Routing.masquerade)
|
||||||
@@ -77,7 +76,7 @@ class TetheringService : IpNeighbourMonitoringService() {
|
|||||||
revert()
|
revert()
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Timber.w(e)
|
Timber.w(e)
|
||||||
SmartSnackbar.make(e).show()
|
SmartSnackbar.make(e).show()
|
||||||
|
|||||||
Reference in New Issue
Block a user