From 9ceb3d4acc1051563084763883938fd3c4b98ecb Mon Sep 17 00:00:00 2001 From: Max Cai Date: Thu, 3 Jul 2014 12:27:04 +0100 Subject: [PATCH] Fix how getRepeatedFieldArrayLength works Change-Id: I01921eff008a8e3f7b1fbeb653d15ff8038d3220 --- .../main/java/com/google/protobuf/nano/WireFormatNano.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/java/src/main/java/com/google/protobuf/nano/WireFormatNano.java b/java/src/main/java/com/google/protobuf/nano/WireFormatNano.java index 1ff8f06fb6..a3405e558f 100644 --- a/java/src/main/java/com/google/protobuf/nano/WireFormatNano.java +++ b/java/src/main/java/com/google/protobuf/nano/WireFormatNano.java @@ -113,11 +113,7 @@ public final class WireFormatNano { int arrayLength = 1; int startPos = input.getPosition(); input.skipField(tag); - while (input.getBytesUntilLimit() > 0) { - int thisTag = input.readTag(); - if (thisTag != tag) { - break; - } + while (input.readTag() == tag) { input.skipField(tag); arrayLength++; }