diff options
author | Dave MacLachlan <dmaclach@gmail.com> | 2017-11-15 08:41:29 -0800 |
---|---|---|
committer | Dave MacLachlan <dmaclach@gmail.com> | 2017-11-15 08:41:29 -0800 |
commit | 4ba30923fabfca78a0d8cbef8e153bd2fb83ad17 (patch) | |
tree | c9b7c9886bad0145b4ddcdf353b2d9fcb148d019 /objectivec | |
parent | 949596ea328978b4af38657d8831292b62b24686 (diff) | |
download | protobuf-4ba30923fabfca78a0d8cbef8e153bd2fb83ad17.tar.gz protobuf-4ba30923fabfca78a0d8cbef8e153bd2fb83ad17.tar.bz2 protobuf-4ba30923fabfca78a0d8cbef8e153bd2fb83ad17.zip |
code review cleanup
Diffstat (limited to 'objectivec')
-rw-r--r-- | objectivec/GPBMessage.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m index 649ed8a6..90485bd1 100644 --- a/objectivec/GPBMessage.m +++ b/objectivec/GPBMessage.m @@ -2998,6 +2998,9 @@ typedef struct ResolveIvarAccessorMethodResult { SEL encodingSelector; } 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, ResolveIvarAccessorMethodResult *result) { GPBDataType fieldDataType = GPBGetFieldDataType(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, GPBFileSyntax syntax, ResolveIvarAccessorMethodResult *result) { @@ -3084,13 +3088,9 @@ static void ResolveIvarSet(__unsafe_unretained GPBFieldDescriptor *field, // 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 // no need for checks here to see if has*/setHas* are allowed. - ResolveIvarAccessorMethodResult result = {NULL, NULL}; - - // |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. + // See comment about __unsafe_unretained on ResolveIvarGet. for (__unsafe_unretained GPBFieldDescriptor *field in descriptor->fields_) { BOOL isMapOrArray = GPBFieldIsMapOrArray(field); if (!isMapOrArray) { |