optimize some code (#9289)

Motivation:

There is some manual coping of elements of Collections which can be replaced by Collections.addAll(...) and also some unnecessary semicolons.

Modifications:

- Simplify branches
- Use Collections.addAll
- Code cleanup

Result:

Code cleanup
This commit is contained in:
jimin 2019-06-28 19:48:23 +08:00 committed by Norman Maurer
parent 8d43869369
commit 500bb5db8e
2 changed files with 3 additions and 3 deletions

View File

@ -477,12 +477,12 @@ final class ReplayingDecoderByteBuf extends ByteBuf {
@Override
public boolean isReadable() {
return terminated? buffer.isReadable() : true;
return !terminated || buffer.isReadable();
}
@Override
public boolean isReadable(int size) {
return terminated? buffer.isReadable(size) : true;
return !terminated || buffer.isReadable(size);
}
@Override

View File

@ -50,7 +50,7 @@ public class Log4J2LoggerTest extends AbstractInternalLoggerTest<Logger> {
result.put("level", level.name());
result.put("t", t);
super.logMessage(fqcn, level, marker, message, t);
};
}
};
}