Commit 4c559316 authored by Thomas Van Lenten's avatar Thomas Van Lenten

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.
parent cecba296
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment