From: Jay Freeman (saurik) Date: Mon, 15 Nov 2010 20:01:34 +0000 (-0800) Subject: Avoid NSMutableArray for temporary radix buffer. X-Git-Tag: v1.0.3366~43 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/fd119f42f8f2894fd3f38dfd8bcd75b973fe18b3 Avoid NSMutableArray for temporary radix buffer. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 6f8737f1..e73cfe7b 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -461,10 +461,11 @@ static void RadixSort_(NSMutableArray *self, size_t count, struct RadixItem_ *sw delete [] hist; - NSMutableArray *values([NSMutableArray arrayWithCapacity:count]); + const void **values(new const void *[count]); for (size_t i(0); i != count; ++i) - [values addObject:[self objectAtIndex:lhs[i].index]]; - [self setArray:values]; + values[i] = [self objectAtIndex:lhs[i].index]; + CFArrayReplaceValues((CFMutableArrayRef) self, CFRangeMake(0, count), values, count); + delete [] values; delete [] swap; }