Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92239739 authored by Jesse Vincent's avatar Jesse Vincent
Browse files

microoptimize peekableInputStream's peek method to not do an extra

method dispatch and boolean check on every peek.
parent 29117ae7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ public class PeekableInputStream extends InputStream {


    public int peek() throws IOException {
    public int peek() throws IOException {
        if (!mPeeked) {
        if (!mPeeked) {
            mPeekedByte = read();
            mPeekedByte = mIn.read();
            mPeeked = true;
            mPeeked = true;
        }
        }
        return mPeekedByte;
        return mPeekedByte;