Skip to content

Commit 6b889d8

Browse files
committed
Inline single use local variables
Better comment wording
1 parent 0029e29 commit 6b889d8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/main/java/org/apache/commons/io/RandomAccessFiles.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import java.io.IOException;
2121
import java.io.RandomAccessFile;
22-
import java.nio.channels.FileChannel;
2322
import java.util.Objects;
2423

2524
import org.apache.commons.io.channels.FileChannels;
@@ -56,11 +55,9 @@ public static boolean contentEquals(final RandomAccessFile raf1, final RandomAcc
5655
return true;
5756
}
5857
// Dig in and to the work
59-
// We do not close FileChannels because that closes the owning RandomAccessFile.
58+
// We do not close FileChannels because that would close the owning RandomAccessFile.
6059
// Instead, the caller is assumed to manage the given RandomAccessFile objects.
61-
final FileChannel channel1 = raf1.getChannel();
62-
final FileChannel channel2 = raf2.getChannel();
63-
return FileChannels.contentEquals(channel1, channel2, IOUtils.DEFAULT_BUFFER_SIZE);
60+
return FileChannels.contentEquals(raf1.getChannel(), raf2.getChannel(), IOUtils.DEFAULT_BUFFER_SIZE);
6461
}
6562

6663
private static long length(final RandomAccessFile raf) throws IOException {

0 commit comments

Comments
 (0)