Skip to content

Commit 06f1e05

Browse files
committed
1 parent 26be870 commit 06f1e05

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

java-diff-utils/src/main/java/com/github/difflib/patch/AbstractDelta.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ public boolean equals(Object obj) {
9090
if (!Objects.equals(this.target, other.target)) {
9191
return false;
9292
}
93-
if (this.type != other.type) {
94-
return false;
95-
}
96-
return true;
93+
return this.type == other.type;
9794
}
9895
}

java-diff-utils/src/main/java/com/github/difflib/unifieddiff/UnifiedDiffReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private UnifiedDiff parse() throws IOException, UnifiedDiffParserException {
9191
if (!CHUNK.validLine(line)) {
9292
initFileIfNecessary();
9393
while (line != null && !CHUNK.validLine(line)) {
94-
if (processLine(line, DIFF_COMMAND, INDEX, FROM_FILE, TO_FILE, NEW_FILE_MODE, DELETED_FILE_MODE) == false) {
94+
if (!processLine(line, DIFF_COMMAND, INDEX, FROM_FILE, TO_FILE, NEW_FILE_MODE, DELETED_FILE_MODE)) {
9595
throw new UnifiedDiffParserException("expected file start line not found");
9696
}
9797
line = READER.readLine();
@@ -100,7 +100,7 @@ private UnifiedDiff parse() throws IOException, UnifiedDiffParserException {
100100
if (line != null) {
101101
processLine(line, CHUNK);
102102
while ((line = READER.readLine()) != null) {
103-
if (processLine(line, LINE_NORMAL, LINE_ADD, LINE_DEL) == false) {
103+
if (!processLine(line, LINE_NORMAL, LINE_ADD, LINE_DEL)) {
104104
throw new UnifiedDiffParserException("expected data line not found");
105105
}
106106
if ((originalTxt.size() == old_size && revisedTxt.size() == new_size)

0 commit comments

Comments
 (0)