Skip to content

Commit

Permalink
Remove redundant syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 12, 2024
1 parent fbc72c9 commit 6cc3e4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/apache/commons/text/TextStringBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public int read() {
if (!ready()) {
return -1;
}
return TextStringBuilder.this.charAt(pos++);
return charAt(pos++);
}

/** {@inheritDoc} */
Expand All @@ -129,11 +129,11 @@ public int read(final char[] b, final int off, int len) {
if (len == 0) {
return 0;
}
if (pos >= TextStringBuilder.this.size()) {
if (pos >= size()) {
return -1;
}
if (pos + len > size()) {
len = TextStringBuilder.this.size() - pos;
len = size() - pos;
}
TextStringBuilder.this.getChars(pos, pos + len, b, off);
pos += len;
Expand All @@ -143,7 +143,7 @@ public int read(final char[] b, final int off, int len) {
/** {@inheritDoc} */
@Override
public boolean ready() {
return pos < TextStringBuilder.this.size();
return pos < size();
}

/** {@inheritDoc} */
Expand All @@ -155,8 +155,8 @@ public void reset() {
/** {@inheritDoc} */
@Override
public long skip(long n) {
if (pos + n > TextStringBuilder.this.size()) {
n = TextStringBuilder.this.size() - pos;
if (pos + n > size()) {
n = size() - pos;
}
if (n < 0) {
return 0;
Expand Down Expand Up @@ -191,7 +191,7 @@ public String getContent() {
@Override
protected List<String> tokenize(final char[] chars, final int offset, final int count) {
if (chars == null) {
return super.tokenize(TextStringBuilder.this.getBuffer(), 0, TextStringBuilder.this.size());
return super.tokenize(getBuffer(), 0, TextStringBuilder.this.size());
}
return super.tokenize(chars, offset, count);
}
Expand Down

0 comments on commit 6cc3e4b

Please sign in to comment.