Commit 4ba30923 authored by Dave MacLachlan's avatar Dave MacLachlan

code review cleanup

parent 949596ea
...@@ -2998,6 +2998,9 @@ typedef struct ResolveIvarAccessorMethodResult { ...@@ -2998,6 +2998,9 @@ typedef struct ResolveIvarAccessorMethodResult {
SEL encodingSelector; SEL encodingSelector;
} ResolveIvarAccessorMethodResult; } ResolveIvarAccessorMethodResult;
// |field| can be __unsafe_unretained because they are created at startup
// and are essentially global. No need to pay for retain/release when
// they are captured in blocks.
static void ResolveIvarGet(__unsafe_unretained GPBFieldDescriptor *field, static void ResolveIvarGet(__unsafe_unretained GPBFieldDescriptor *field,
ResolveIvarAccessorMethodResult *result) { ResolveIvarAccessorMethodResult *result) {
GPBDataType fieldDataType = GPBGetFieldDataType(field); GPBDataType fieldDataType = GPBGetFieldDataType(field);
...@@ -3040,6 +3043,7 @@ static void ResolveIvarGet(__unsafe_unretained GPBFieldDescriptor *field, ...@@ -3040,6 +3043,7 @@ static void ResolveIvarGet(__unsafe_unretained GPBFieldDescriptor *field,
} }
} }
// See comment about __unsafe_unretained on ResolveIvarGet.
static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field, static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field,
GPBFileSyntax syntax, GPBFileSyntax syntax,
ResolveIvarAccessorMethodResult *result) { ResolveIvarAccessorMethodResult *result) {
...@@ -3084,13 +3088,9 @@ static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field, ...@@ -3084,13 +3088,9 @@ static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field,
// NOTE: hasOrCountSel_/setHasSel_ will be NULL if the field for the given // NOTE: hasOrCountSel_/setHasSel_ will be NULL if the field for the given
// message should not have has support (done in GPBDescriptor.m), so there is // message should not have has support (done in GPBDescriptor.m), so there is
// no need for checks here to see if has*/setHas* are allowed. // no need for checks here to see if has*/setHas* are allowed.
ResolveIvarAccessorMethodResult result = {NULL, NULL}; ResolveIvarAccessorMethodResult result = {NULL, NULL};
// See comment about __unsafe_unretained on ResolveIvarGet.
// |field| can be __unsafe_unretained because they are created at startup
// and are essentially global. No need to pay for retain/release when
// they are captured in blocks.
for (__unsafe_unretained GPBFieldDescriptor *field in descriptor->fields_) { for (__unsafe_unretained GPBFieldDescriptor *field in descriptor->fields_) {
BOOL isMapOrArray = GPBFieldIsMapOrArray(field); BOOL isMapOrArray = GPBFieldIsMapOrArray(field);
if (!isMapOrArray) { if (!isMapOrArray) {
......
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