errorprone reports:
[OperatorPrecedence] Use grouping parenthesis to make the
operator precedence explicit
Take the chance to fix also
https://errorprone.info/bugpattern/YodaCondition in the same lines.
Change-Id: I6d8f00842ef2bb24cd00fc413121b8a4e20c186b
byte current;
while (ptr < length - 2) {
current = raw[++ptr];
- if ('\0' == current || '\r' == current && raw[++ptr] != '\n') {
+ if (current == '\0' || (current == '\r' && raw[++ptr] != '\n')) {
return true;
}
}
if (ptr == length - 2) {
// if '\r' be last, then if isComplete then return binary
current = raw[++ptr];
- return '\0' == current || '\r' == current && isComplete;
+ return current == '\0' || (current == '\r' && isComplete);
}
return false;
if (ptr == length - 2) {
// if '\r' be last, then if isComplete then return binary
current = raw[++ptr];
- if('\0' == current || '\r' == current && complete){
+ if (current == '\0' || (current == '\r' && complete)) {
return false;
}
}