From a421f2289f3e2ecfdf411e1b782a82279291ddd5 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 7 Jun 2011 23:15:12 +0000 Subject: [PATCH] When moving objects in an array from an index to a lower index, no need to first fill the final destination with the object before it. This is pointless and causes issues when moving the item to index 0. --- macosx/NSMutableArrayAdditions.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/NSMutableArrayAdditions.m b/macosx/NSMutableArrayAdditions.m index 0a18b6005..7de381059 100644 --- a/macosx/NSMutableArrayAdditions.m +++ b/macosx/NSMutableArrayAdditions.m @@ -41,7 +41,7 @@ } else { - for (NSUInteger i = fromIndex; i >= toIndex; --i) + for (NSUInteger i = fromIndex; i > toIndex; --i) [self replaceObjectAtIndex: i withObject: [self objectAtIndex: i-1]]; } [self replaceObjectAtIndex: toIndex withObject: object];