Skip to content

Commit 52a5c4b

Browse files
author
Alex Stockinger
committed
Apply review feedback
1 parent 4f28875 commit 52a5c4b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

core/src/main/java/org/testcontainers/containers/GenericContainer.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,12 @@ Checksum hashCopiedFiles() {
543543
byte[] bytes = string.getBytes();
544544
checksum.update(bytes, 0, bytes.length);
545545
};
546-
copyToFileContainerPathMap.entrySet().stream().sorted(Entry.comparingByValue()).forEach(entry -> {
547-
updateFromString.accept(entry.getValue());
548-
entry.getKey().updateChecksum(checksum);
549-
});
550-
copyToTransferableContainerPathMap.entrySet().stream().sorted(Entry.comparingByValue()).forEach(entry -> {
551-
updateFromString.accept(entry.getValue());
552-
entry.getKey().updateChecksum(checksum);
553-
});
546+
Stream.of(copyToFileContainerPathMap, copyToTransferableContainerPathMap)
547+
.flatMap(it -> it.entrySet().stream())
548+
.sorted(Entry.comparingByValue()).forEach(entry -> {
549+
updateFromString.accept(entry.getValue());
550+
entry.getKey().updateChecksum(checksum);
551+
});
554552
return checksum;
555553
}
556554

core/src/main/java/org/testcontainers/images/builder/Transferable.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public byte[] getBytes() {
3535

3636
@Override
3737
public void updateChecksum(Checksum checksum) {
38-
byte[] bytes = getBytes();
3938
checksum.update(bytes, 0, bytes.length);
4039
}
4140

0 commit comments

Comments
 (0)