Skip to content

Commit

Permalink
Remove useless matches variable istitle method
Browse files Browse the repository at this point in the history
  • Loading branch information
onyb committed Oct 27, 2017
1 parent c4c2495 commit 859637f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions python/common/org/python/types/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -1082,11 +1082,11 @@ public org.python.Object istitle() {
return new org.python.types.Bool(false);
}

boolean matches = Arrays.equals(this.value, _title(this.value));

for (int idx = 0; idx < this.value.length; ++idx) {
if (_isalpha(this.value[idx]) && matches) {
return new org.python.types.Bool(true);
if (Arrays.equals(this.value, _title(this.value))) {
for (int idx = 0; idx < this.value.length; ++idx) {
if (_isalpha(this.value[idx])) {
return new org.python.types.Bool(true);
}
}
}

Expand Down
11 changes: 6 additions & 5 deletions python/common/org/python/types/Str.java
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,14 @@ public org.python.Object istitle() {
return new org.python.types.Bool(false);
}

boolean matches = this.value.equals(_title(this.value));

for (int idx = 0; idx < this.value.length(); idx++) {
if (Character.isLetter(this.value.charAt(idx)) && matches) {
return new org.python.types.Bool(true);
if (this.value.equals(_title(this.value))) {
for (int idx = 0; idx < this.value.length(); idx++) {
if (Character.isLetter(this.value.charAt(idx))) {
return new org.python.types.Bool(true);
}
}
}

return new org.python.types.Bool(false);
}

Expand Down

0 comments on commit 859637f

Please sign in to comment.