Better -copy implementations for KVC arrays and sets.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2011-01-09 03:46:29 -08:00
1 parent 028a4fe5b2
commit 5af66b60e1
3 files changed
+7 -13

No files matched your search

+2 -2
View File
@@ -35,12 +35,12 @@ var indexOf = Array.prototype.indexOf,
- (id)initWithArray:(CPArray)anArray
{
return slice.call(anArray, 0);
return [self initWithArray:anArray copyItems:NO];
}
- (id)initWithArray:(CPArray)anArray copyItems:(BOOL)shouldCopyItems
{
if (!shouldCopyItems)
if (!shouldCopyItems && anArray.isa === _CPJavaScriptArray)
return slice.call(anArray, 0);
self = [super init];