Changeset 15 for Trunk/AILogSizeSort.m
- Timestamp:
- 09/29/08 23:42:07 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Trunk/AILogSizeSort.m
r11 r15 175 175 } 176 176 177 unsigned long long sizeA = [AILogSizeSort getContactLogSize:objectA]; 178 unsigned long long sizeB = [AILogSizeSort getContactLogSize:objectB]; 177 179 178 NSNumber *sizeA = [NSNumber numberWithUnsignedLongLong:[AILogSizeSort getContactLogSize:objectA]]; 179 NSNumber *sizeB = [NSNumber numberWithUnsignedLongLong:[AILogSizeSort getContactLogSize:objectB]]; 180 181 if([sizeB compare:sizeA] == NSOrderedSame) 180 if(sizeB == sizeA) 182 181 { 183 182 // Fall back to basic alphabetical sorting in the event of a tie. 184 183 return [[objectA displayName] caseInsensitiveCompare:[objectB displayName]]; 185 184 } 185 else if(sizeA > sizeB) 186 { 187 // There's a clear winner; run with it. 188 return NSOrderedAscending; 189 } 186 190 else 187 191 { 188 // There's a clear winner; run with it. 189 return [sizeB compare:sizeA]; 192 return NSOrderedDescending; 190 193 } 191 194 }