diff --git a/okio/src/jvmMain/kotlin/okio/Pipe.kt b/okio/src/jvmMain/kotlin/okio/Pipe.kt index 80d252ec33..fab20575d3 100644 --- a/okio/src/jvmMain/kotlin/okio/Pipe.kt +++ b/okio/src/jvmMain/kotlin/okio/Pipe.kt @@ -57,10 +57,7 @@ class Pipe(internal val maxBufferSize: Long) { while (byteCount > 0) { timeout.waitUntil(buffer) { - maxBufferSize - buffer.size > 0L // The source has drained the buffer - || canceled - || sourceClosed - || foldedSink != null // fold was called + maxBufferSize - buffer.size > 0L || canceled || sourceClosed || foldedSink != null } foldedSink?.let { diff --git a/okio/src/jvmMain/kotlin/okio/Timeout.kt b/okio/src/jvmMain/kotlin/okio/Timeout.kt index 4ebb09dd1c..380e945eda 100644 --- a/okio/src/jvmMain/kotlin/okio/Timeout.kt +++ b/okio/src/jvmMain/kotlin/okio/Timeout.kt @@ -215,7 +215,7 @@ actual open class Timeout { (monitor as Object).wait() } else { val waitNanos = waitUntilNanos - System.nanoTime() - if ( waitNanos < 0) { + if (waitNanos < 0) { throw InterruptedIOException("timeout") } val waitMillis = waitNanos / 1000000L @@ -227,7 +227,6 @@ actual open class Timeout { } } - /** * Applies the minimum intersection between this timeout and `other`, run `block`, then finally * rollback this timeout's values.