Skip to content

Commit c01ba7e

Browse files
committed
Minor tidies.
1 parent d45a4cc commit c01ba7e

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

JSONKit.m

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,7 @@ + (void)load
597597

598598
_JKArrayClass = objc_getClass("JKArray");
599599
_JKMutableArrayClass = objc_getClass("JKMutableArray");
600-
_JKArrayInstanceSize = class_getInstanceSize(_JKArrayClass);
601-
if(_JKArrayInstanceSize < 16UL) { _JKArrayInstanceSize = 16UL; }
600+
_JKArrayInstanceSize = jk_max(16UL, class_getInstanceSize(_JKArrayClass));
602601

603602
[pool release]; pool = NULL;
604603
}
@@ -759,27 +758,13 @@ - (void)insertObject:(id)anObject atIndex:(NSUInteger)objectIndex
759758
_JKArrayIncrementMutations((JKArray *)self);
760759
}
761760

762-
/*
763-
- (void)addObject:(id)anObject
764-
{
765-
[self insertObject:anObject atIndex:_JKArrayCount((JKArray *)self)];
766-
}
767-
*/
768-
769761
- (void)removeObjectAtIndex:(NSUInteger)objectIndex
770762
{
771763
if(objectIndex >= _JKArrayCount((JKArray *)self)) { [NSException raise:NSRangeException format:@"*** -[%@ %@]: index (%lu) beyond bounds (%lu)", NSStringFromClass([self class]), NSStringFromSelector(_cmd), objectIndex, _JKArrayCount((JKArray *)self)]; }
772764
_JKArrayRemoveObjectAtIndex((JKArray *)self, objectIndex);
773765
_JKArrayIncrementMutations((JKArray *)self);
774766
}
775767

776-
/*
777-
- (void)removeLastObject
778-
{
779-
[self removeObjectAtIndex:_JKArrayCount((JKArray *)self) == 0UL ? 0UL : (_JKArrayCount((JKArray *)self) - 1UL)];
780-
}
781-
*/
782-
783768
- (void)replaceObjectAtIndex:(NSUInteger)objectIndex withObject:(id)anObject
784769
{
785770
if(anObject == NULL) { [NSException raise:NSInvalidArgumentException format:@"*** -[%@ %@]: attempt to insert nil", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }
@@ -882,8 +867,7 @@ + (void)load
882867

883868
_JKDictionaryClass = objc_getClass("JKDictionary");
884869
_JKMutableDictionaryClass = objc_getClass("JKMutableDictionary");
885-
_JKDictionaryInstanceSize = class_getInstanceSize(_JKDictionaryClass);
886-
if(_JKDictionaryInstanceSize < 16UL) { _JKDictionaryInstanceSize = 16UL; }
870+
_JKDictionaryInstanceSize = jk_max(16UL, class_getInstanceSize(_JKDictionaryClass));
887871

888872
[pool release]; pool = NULL;
889873
}

0 commit comments

Comments
 (0)