Skip to content

Commit

Permalink
[debt] simplify bundlebee-directory-json-key-value-pairs code
Browse files Browse the repository at this point in the history
  • Loading branch information
rmannibucau committed Jan 30, 2024
1 parent a564f2a commit 96601ce
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,7 @@ protected String doSubstitute(final AtomicReference<Substitutor> self, final Con
try (final var dir = lastSep < 0 ?
Files.newDirectoryStream(Path.of(directory)) :
Files.newDirectoryStream(Path.of(directory.substring(0, lastSep)), directory.substring(lastSep + 1));
final var stream = stream(Spliterators.spliteratorUnknownSize(dir.iterator(), Spliterator.DISTINCT), false)
.onClose(() -> {
try {
dir.close();
} catch (final IOException ioe) {
throw new IllegalStateException(ioe);
}
})) {
final var stream = stream(Spliterators.spliteratorUnknownSize(dir.iterator(), Spliterator.DISTINCT), false)) {
return stream
.sorted(comparing(Path::getFileName))
.collect(Collector.of(
Expand Down

0 comments on commit 96601ce

Please # to comment.