Browse files

Removed direct use of ->isa and replaced with object_getClass()

  • Loading branch information...
1 parent e63a18a commit bebf3b26f8337c7a664725e6a0244621610eae4e @mugginsoft committed Nov 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 FScriptFramework/FSArray.m
View
4 FScriptFramework/FSArray.m
@@ -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]];
@@ -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]];

0 comments on commit bebf3b2

Please sign in to comment.