Skip to content

Commit

Permalink
Remove the unreachable checking code
Browse files Browse the repository at this point in the history
Motivation:
'length2 == 0' is not reachable because length1 and length2 are same at this point.

Motification:
Removed 'length2 == 0'.

Result:
Cleaner code.
  • Loading branch information
JongYoon Lim authored and normanmaurer committed Apr 30, 2015
1 parent ad9bec4 commit 05f9593
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions common/src/main/java/io/netty/util/AsciiString.java
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,7 @@ public boolean contentEquals(CharSequence cs) {
int length2 = cs.length();
if (length1 != length2) {
return false;
}

if (length1 == 0 && length2 == 0) {
} else if (length1 == 0) {
return true; // since both are empty strings
}

Expand Down

0 comments on commit 05f9593

Please sign in to comment.