Skip to content

Commit 63c6ec4

Browse files
committed
Comparing to Integer.MAX_VALUE - 1 does not get binned by HotSpot
1 parent 0092d79 commit 63c6ec4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/rabbitmq/client/impl/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public synchronized ChannelN createChannel(AMQConnection connection, int channel
9898

9999
public synchronized int allocateChannelNumber(int maxChannels) {
100100
if (maxChannels == 0) {
101-
maxChannels = Integer.MAX_VALUE;
101+
maxChannels = Integer.MAX_VALUE - 1;
102102
}
103103
int channelNumber = -1;
104104
for (int candidate = 1; candidate <= maxChannels; candidate++) {

0 commit comments

Comments
 (0)