Fix forEachLine is not inline
This commit is contained in:
@@ -75,11 +75,12 @@ abstract class IpMonitor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
process.inputStream.bufferedReader().forEachLine {
|
process.inputStream.bufferedReader().useLines { lines ->
|
||||||
if (errorMatcher.containsMatchIn(it)) {
|
for (line in lines) if (errorMatcher.containsMatchIn(line)) {
|
||||||
Timber.w(it)
|
Timber.w(line)
|
||||||
process.destroy() // move on to next mode
|
process.destroy()
|
||||||
} else processLine(it)
|
break // move on to next mode
|
||||||
|
} else processLine(line)
|
||||||
}
|
}
|
||||||
} catch (_: InterruptedIOException) { } catch (e: IOException) {
|
} catch (_: InterruptedIOException) { } catch (e: IOException) {
|
||||||
if (!e.isEBADF) Timber.w(e)
|
if (!e.isEBADF) Timber.w(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user