Permalink
Browse files

cache string used for description.

  • Loading branch information...
1 parent 91100be commit f09074cf83b3df88ed4be179ebf33fb8ca411ed7 @stig committed Aug 6, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 Classes/Location.m
View
@@ -53,7 +53,9 @@ - (id)copyWithZone:(NSZone*)zone {
#pragma mark description
- (NSString*)description {
- return [NSString stringWithFormat:@"%u@%u", self.column, self.row];
+ static NSString *name = nil;
+ if (!name) name = [[NSString alloc] initWithFormat:@"%u@%u", self.column, self.row];
+ return name;
}
#pragma mark equality

0 comments on commit f09074c

Please sign in to comment.