summaryrefslogtreecommitdiff
path: root/Menes/radixSortWithSelector.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-07 13:21:32 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-08 01:50:59 -0800
commit9c5737d51187a49f64adf864939f1d312eee410e (patch)
treeee9f3c029ce75ba269af7a38c45f9a602745e5e7 /Menes/radixSortWithSelector.mm
parentc28bc6f17b73cc9da12bef41c6f69d1595466df4 (diff)
First draft of relevancy sorted search.
Diffstat (limited to 'Menes/radixSortWithSelector.mm')
-rw-r--r--Menes/radixSortWithSelector.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Menes/radixSortWithSelector.mm b/Menes/radixSortWithSelector.mm
index 949a14b..f61dd99 100644
--- a/Menes/radixSortWithSelector.mm
+++ b/Menes/radixSortWithSelector.mm
@@ -41,6 +41,8 @@
#include "Menes/radixSortWithSelector.h"
+#include <objc/runtime.h>
+
struct RadixItem_ {
size_t index;
uint32_t key;
@@ -109,4 +111,12 @@ struct RadixItem_ {
delete [] swap;
}
+- (void) radixSortUsingSelector:(SEL)selector {
+ if ([self count] == 0)
+ return;
+
+ IMP imp(class_getMethodImplementation([[self lastObject] class], selector));
+ [self radixSortUsingFunction:reinterpret_cast<MenesRadixSortFunction>(imp) withContext:selector];
+}
+
@end