Skip to content

Commit

Permalink
chore: Extract mark field to local variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstdio committed Mar 18, 2022
1 parent cbfc2b4 commit eeaf224
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,23 @@ public synchronized void mark(int readlimit) {
}

private void mark0(int b) {
if (mark != null) {
if (mark.hasRemaining()) {
mark.put((byte) b);
ByteBuffer m;
if ((m = mark) != null) {
if (m.hasRemaining()) {
m.put((byte) b);
} else {
mark = null;
}
}
}

private void mark0(byte[] b, int off, int len) {
if (mark != null) {
int rem = mark.remaining();
if (len > rem) {
mark = null;
ByteBuffer m;
if ((m = mark) != null) {
if (len <= m.remaining()) {
m.put(b, off, len);
} else {
mark.put(b, off, len);
mark = null;
}
}
}
Expand Down

0 comments on commit eeaf224

Please sign in to comment.