-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Description
Line 779 in setObjectHasWeakRefs() performs the following check:
if (obj && cls && objc_test_class_flag(cls, objc_class_flag_fast_arc))
Immediately below on line 782, obj is tested again:
if (obj)
In between the two checks, obj is not modified in any (observable) way. The surrounding body looks like this:
static BOOL setObjectHasWeakRefs(id obj)
{
BOOL isGlobalObject = isPersistentObject(obj);
Class cls = isGlobalObject ? Nil : obj->isa;
if (obj && cls && objc_test_class_flag(cls, objc_class_flag_fast_arc))
{
uintptr_t *refCount = ((uintptr_t*)obj) - 1;
if (obj)
{
<...>
Would it make sense to remove the second seemingly unnecessary check for obj? Stylistically, this would also remove one indentation level, which is (in my opinion) also desirable.
Metadata
Metadata
Assignees
Labels
No labels