You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/04/30 17:18:33 UTC
(commons-io) 01/02: Simplify internals
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit d34090bf299809e873e1e8c8eded81fa6f59f6d7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Apr 30 12:50:37 2024 -0400
Simplify internals
---
.../commons/io/input/WindowsLineEndingInputStream.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
index 6be7e73a8..d5fe26f8f 100644
--- a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
@@ -28,7 +28,7 @@ import java.io.InputStream;
*
* @since 2.5
*/
-public class WindowsLineEndingInputStream extends InputStream {
+public class WindowsLineEndingInputStream extends InputStream {
private boolean atEos;
@@ -119,17 +119,17 @@ public class WindowsLineEndingInputStream extends InputStream {
/**
* Reads the next item from the target, updating internal flags in the process
+ *
* @return the next int read from the target stream
* @throws IOException upon error
*/
private int readWithUpdate() throws IOException {
- final int target = this.in.read();
+ final int target = in.read();
atEos = target == EOF;
- if (atEos) {
- return target;
+ if (!atEos) {
+ atSlashCr = target == CR;
+ atSlashLf = target == LF;
}
- atSlashCr = target == CR;
- atSlashLf = target == LF;
return target;
}
}