Skip to content

Commit bebf3b2

Browse files
author
Jonathan Mitchell
committed
Removed direct use of ->isa and replaced with object_getClass()
1 parent e63a18a commit bebf3b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

FScriptFramework/FSArray.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ - (void)addObject:(id)anObject
148148
{
149149
case DOUBLE:
150150
{
151-
if (anObject && ((struct {Class isa;} *)anObject)->isa == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
151+
if (anObject && object_getClass(anObject) == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
152152
[(ArrayRepDouble *)rep addDouble:((FSNumber *)anObject)->value ];
153153
else if (anObject && isNSNumberWithLosslessConversionToDouble(anObject))
154154
[(ArrayRepDouble *)rep addDouble:[(NSNumber *)anObject doubleValue]];
@@ -627,7 +627,7 @@ - (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject
627627

628628
if (type == DOUBLE)
629629
{
630-
if (anObject && ((struct {Class isa;} *)anObject)->isa == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
630+
if (anObject && object_getClass(anObject) == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
631631
[(ArrayRepDouble *)rep replaceDoubleAtIndex:index withDouble:((FSNumber *)anObject)->value];
632632
else if (anObject && isNSNumberWithLosslessConversionToDouble(anObject))
633633
[(ArrayRepDouble *)rep replaceDoubleAtIndex:index withDouble:[anObject doubleValue]];

0 commit comments

Comments
 (0)