Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Jan 8, 2020
1 parent ee0a90b commit 8cbce6a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/com/esaulpaugh/headlong/rlp/RLPDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ public Iterator<RLPItem> sequenceIterator(byte[] buffer, int index) {

@Override
public boolean hasNext() {
if(next != null) {
if (next != null) {
return true;
}
if(index >= buffer.length) {
return false;
}
try {
next = decoder.wrap(buffer, index);
this.index = next.endIndex;
return true;
} catch (DecodeException de) {
throw noSuchElementException(de);
if (index < buffer.length) {
try {
next = decoder.wrap(buffer, index);
this.index = next.endIndex;
return true;
} catch (DecodeException de) {
throw noSuchElementException(de);
}
}
return false;
}
};
}
Expand Down

0 comments on commit 8cbce6a

Please sign in to comment.