Skip to content

Commit e9463af

Browse files
committed
fix: (buffersink) copy map for flow emit
1 parent ecd06c9 commit e9463af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/dev/silenium/libs/flows/buffer/BufferSink.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BufferSink<T, P>(vararg pads: Pair<UInt, P>) : Sink<T, P> {
1717

1818
override suspend fun receive(item: FlowItem<T, P>): Result<Unit> {
1919
buffer_.getOrPut(item.pad, ::mutableListOf).add(item)
20-
flow_.emit(buffer)
20+
flow_.emit(buffer.entries.associate { it.key to it.value.toList() })
2121
return Result.success(Unit)
2222
}
2323

0 commit comments

Comments
 (0)