Skip to content

Commit fb31c2f

Browse files
committed
Readability updates
1 parent 46dc952 commit fb31c2f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/org/radarbase/output/util/AvroFileLister.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class AvroFileLister(private val storage: SourceStorage) :
1616
val filename = status.path.fileName.toString()
1717
when {
1818
status.isDirectory && filename != "+tmp" -> descend(context.copy(path = status.path))
19-
filename.endsWith(".avro") -> emit(storage.createTopicFile(context.topic,
20-
status))
19+
filename.endsWith(".avro") -> emit(storage.createTopicFile(context.topic, status))
2120
else -> {}
2221
}
2322
}

src/main/java/org/radarbase/output/util/TreeLister.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TreeLister<T, C>(
2727
coroutineScope {
2828
descend(
2929
context,
30-
if (predicate == null) channel::send else ({ if (predicate(it)) channel.send(it) }),
30+
if (predicate == null) channel::send else ({ value -> if (predicate(value)) channel.send(value) }),
3131
)
3232
}
3333
channel.close()
@@ -39,15 +39,15 @@ class TreeLister<T, C>(
3939
}
4040
producer.cancel()
4141
} catch (ex: ClosedReceiveChannelException) {
42-
// done
42+
// done: channel closed by producer
4343
}
4444

4545
collection
4646
}
4747

48-
private fun CoroutineScope.descend(context: C, send: suspend (T) -> Unit) {
48+
private fun CoroutineScope.descend(context: C, emit: suspend (T) -> Unit) {
4949
levelLister.run {
50-
listLevel(context, { descend(it, send) }, send)
50+
listLevel(context, { descend(it, emit) }, emit)
5151
}
5252
}
5353

0 commit comments

Comments
 (0)