diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2018-12-17 17:19:10 -0500 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2018-12-18 08:11:58 -0500 |
commit | 4c559316e0a623872172a6665367a7c6339ac223 (patch) | |
tree | 74b8e63d7e8dfe9d93877de9b25e16d6080a2dcb /objectivec | |
parent | cecba296b8c49b9dca789a9dc24e01c6c3cfa98f (diff) | |
download | protobuf-4c559316e0a623872172a6665367a7c6339ac223.tar.gz |
Small fix to -[GPBEnumDescriptor getValue:forEnumTextFormatName:]
Don't look up the TextFormat for the value as aliases can trip that
up, instead check the TextFormat names directly and then fetch the
value.
Diffstat (limited to 'objectivec')
-rw-r--r-- | objectivec/GPBDescriptor.m | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/objectivec/GPBDescriptor.m b/objectivec/GPBDescriptor.m index a349f87b9..41bf5adbc 100644 --- a/objectivec/GPBDescriptor.m +++ b/objectivec/GPBDescriptor.m @@ -872,11 +872,10 @@ uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { if (nameOffsets_ == NULL) return NO; for (uint32_t i = 0; i < valueCount_; ++i) { - int32_t value = values_[i]; - NSString *valueTextFormatName = [self textFormatNameForValue:value]; + NSString *valueTextFormatName = [self getEnumTextFormatNameForIndex:i]; if ([valueTextFormatName isEqual:textFormatName]) { if (outValue) { - *outValue = value; + *outValue = values_[i]; } return YES; } |