CollectionUtils.m
changeset 35 5cab3034d3a1
parent 31 2068331949ee
     1.1 --- a/CollectionUtils.m	Thu May 14 20:44:32 2009 -0700
     1.2 +++ b/CollectionUtils.m	Wed Sep 02 08:41:25 2009 -0700
     1.3 @@ -149,19 +149,16 @@
     1.4      }
     1.5  }
     1.6  
     1.7 -
     1.8 -void setString( NSString **var, NSString *value )
     1.9 -{
    1.10 -    if( value != *var ) {
    1.11 +void setObjCopy( id *var, id valueToCopy ) {
    1.12 +    if( valueToCopy != *var ) {
    1.13          [*var release];
    1.14 -        *var = [value copy];
    1.15 +        *var = [valueToCopy copy];
    1.16      }
    1.17  }
    1.18  
    1.19 -
    1.20 -BOOL ifSetString( NSString **var, NSString *value )
    1.21 +BOOL ifSetObjCopy( id *var, id value )
    1.22  {
    1.23 -    if( value != *var && ![value isEqualToString: *var] ) {
    1.24 +    if( value != *var && ![value isEqual: *var] ) {
    1.25          [*var release];
    1.26          *var = [value copy];
    1.27          return YES;