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.
This commit is contained in:
parent
cecba296b8
commit
4c559316e0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user