Skip to content

Commit c0d7ba4

Browse files
author
Simon MacMullen
committed
Fix off-by-one error
1 parent 0d2ebbd commit c0d7ba4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/src/com/rabbitmq/examples/perf/Consumer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ private ConsumerImpl(Channel channel) {
9090

9191
@Override
9292
public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body) throws IOException {
93-
if (msgLimit == 0 || msgCount < msgLimit) {
94-
totalMsgCount++;
95-
msgCount++;
93+
totalMsgCount++;
94+
msgCount++;
9695

96+
if (msgLimit == 0 || msgCount < msgLimit) {
9797
DataInputStream d = new DataInputStream(new ByteArrayInputStream(body));
9898
d.readInt();
9999
long msgNano = d.readLong();

0 commit comments

Comments
 (0)