Skip to content

Commit

Permalink
Removed direct use of ->isa and replaced with object_getClass()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Mitchell committed Nov 26, 2012
1 parent e63a18a commit bebf3b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FScriptFramework/FSArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)addObject:(id)anObject
{
case DOUBLE:
{
if (anObject && ((struct {Class isa;} *)anObject)->isa == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
if (anObject && object_getClass(anObject) == FSNumberClass) // anObject is casted to avoid the warning "static access to object of type id"
[(ArrayRepDouble *)rep addDouble:((FSNumber *)anObject)->value ];
else if (anObject && isNSNumberWithLosslessConversionToDouble(anObject))
[(ArrayRepDouble *)rep addDouble:[(NSNumber *)anObject doubleValue]];
Expand Down Expand Up @@ -627,7 +627,7 @@ - (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject

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

0 comments on commit bebf3b2

Please sign in to comment.