mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
[NSArray lastObject] is already defined; no need for our own version.
This commit is contained in:
parent
b711a5bc3a
commit
924ce23fb5
@ -41,7 +41,6 @@
|
|||||||
@interface NSArray(CaminoNSArrayUtils)
|
@interface NSArray(CaminoNSArrayUtils)
|
||||||
|
|
||||||
- (id)firstObject;
|
- (id)firstObject;
|
||||||
- (id)lastObject;
|
|
||||||
|
|
||||||
// just returns nil if out of range, rather than throwing.
|
// just returns nil if out of range, rather than throwing.
|
||||||
- (id)safeObjectAtIndex:(unsigned)inIndex;
|
- (id)safeObjectAtIndex:(unsigned)inIndex;
|
||||||
|
@ -47,14 +47,6 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)lastObject
|
|
||||||
{
|
|
||||||
if ([self count] > 0)
|
|
||||||
return [self objectAtIndex:[self count] - 1];
|
|
||||||
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)safeObjectAtIndex:(unsigned)inIndex
|
- (id)safeObjectAtIndex:(unsigned)inIndex
|
||||||
{
|
{
|
||||||
return (inIndex < [self count]) ? [self objectAtIndex:inIndex] : nil;
|
return (inIndex < [self count]) ? [self objectAtIndex:inIndex] : nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user