Commit f8a79e87 authored by Daniel Wolf's avatar Daniel Wolf

Set the byte array to null after reading

parent fdd56fa8
Pipeline #7476 failed with stages
in 2 minutes and 8 seconds
......@@ -94,8 +94,9 @@ class TunnelHandle(proxy: Proxy,
fun hasDataForDevice():Boolean = byteReadCounter != byteWriteCounter
internal fun pollBytesToDevice():ByteArray? {
return (byteReadCounter++ % maxConcurrentAnswerSize).let {
byteOutput[it]
val index = byteReadCounter++ % maxConcurrentAnswerSize
return byteOutput[index].also {
byteOutput[index] = null
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment