Skip to content

Commit a0054ef

Browse files
committed
withBufferBig block: ByteBuffer.() ->
1 parent 095379c commit a0054ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/kotlin/uno/buffer/buffer.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ fun ByteBuffer.use(block: (ByteBuffer) -> Unit) {
7878
destroy()
7979
}
8080

81-
fun withBufferBig(size: Int, block: (ByteBuffer) -> Unit) = bufferBig(size).use(block)
81+
fun withBufferBig(size: Int, block: ByteBuffer.() -> Unit) {
82+
with(bufferBig(size)) {
83+
block()
84+
destroy()
85+
}
86+
}

0 commit comments

Comments
 (0)