Merge pull request #22212 from XenoAmess

* gh-22212:
  Polish "Remove redundant bitwise operations"
  Remove redundant bitwise operations

Closes gh-22212
This commit is contained in:
Andy Wilkinson 2020-07-07 10:37:54 +01:00
commit 0200a3783b

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -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();