GeezerVison is showing github.com — fix: the precedence of + is higher than >> (#16312) · netty/netty@e104c6f
File tree
Expand file treeCollapse file tree
Open diff view settings
transport-classes-kqueue/src/main/java/io/netty/channel/kqueue
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventArray.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -99,7 +99,7 @@ private void reallocIfNeeded() { |
99 | 99 | */ |
100 | 100 | void realloc(boolean throwIfFail) { |
101 | 101 | // Double the capacity while it is "sufficiently small", and otherwise increase by 50%. |
102 | | - int newLength = capacity <= 65536 ? capacity << 1 : capacity + capacity >> 1; |
| 102 | + int newLength = capacity <= 65536 ? capacity << 1 : capacity + (capacity >> 1); |
103 | 103 |
|
104 | 104 | try { |
105 | 105 | int newCapacity = calculateBufferCapacity(newLength); |
|
Collapse file
Copy file name to clipboardExpand all lines: transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/NativeLongArray.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,7 @@ private long memoryOffset(int index) { |
88 | 88 | private void reallocIfNeeded() { |
89 | 89 | if (size == capacity) { |
90 | 90 | // Double the capacity while it is "sufficiently small", and otherwise increase by 50%. |
91 | | - int newLength = capacity <= 65536 ? capacity << 1 : capacity + capacity >> 1; |
| 91 | + int newLength = capacity <= 65536 ? capacity << 1 : capacity + (capacity >> 1); |
92 | 92 | int newCapacity = calculateBufferCapacity(newLength); |
93 | 93 | CleanableDirectBuffer buffer = Buffer.allocateDirectBufferWithNativeOrder(newCapacity); |
94 | 94 | // Copy over the old content of the memory and reset the position as we always act on the buffer as if |
|