Remove redundant bitwise operations

See gh-22212
This commit is contained in:
XenoAmess 2020-07-03 18:25:11 +08:00 committed by Andy Wilkinson
parent a118668212
commit de46d4bfd3
1 changed files with 2 additions and 2 deletions

View File

@ -72,12 +72,12 @@ class Frame {
void write(OutputStream outputStream) throws IOException {
outputStream.write(0x80 | this.type.code);
if (this.payload.length < 126) {
outputStream.write(0x00 | (this.payload.length & 0x7F));
outputStream.write(this.payload.length & 0x7F);
}
else {
outputStream.write(0x7E);
outputStream.write(this.payload.length >> 8 & 0xFF);
outputStream.write(this.payload.length >> 0 & 0xFF);
outputStream.write(this.payload.length & 0xFF);
}
outputStream.write(this.payload);
outputStream.flush();