summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-12-07 02:18:46 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-01-01 14:32:06 -0800
commitcf48f65699b65f3aefb5b76bb36a9dbc76fdd6f6 (patch)
treeae09cc5aab1ce83704fd5a2da36bee743d5f98cb
parent8cfba08862aa81912f30886736d16bf3cc5d89a2 (diff)
Add _unlikely() to conditions in -[Package unfiltered].
-rw-r--r--MobileCydia.mm4
-rw-r--r--UICaboodle/UCPlatform.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 2756250..5f9e1d8 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -2478,12 +2478,12 @@ struct PackageNameOrdering :
- (BOOL) unfiltered {
_profile(Package$unfiltered$obsolete)
- if (obsolete_)
+ if (_unlikely(obsolete_))
return false;
_end
_profile(Package$unfiltered$hasSupportingRole)
- if (![self hasSupportingRole])
+ if (_unlikely(![self hasSupportingRole]))
return false;
_end
diff --git a/UICaboodle/UCPlatform.h b/UICaboodle/UCPlatform.h
index 4f2169e..c241232 100644
--- a/UICaboodle/UCPlatform.h
+++ b/UICaboodle/UCPlatform.h
@@ -54,3 +54,9 @@ while (false)
default: \
_assume(false); \
throw;
+
+#define _likely(expr) \
+ __builtin_expect(expr, 1)
+
+#define _unlikely(expr) \
+ __builtin_expect(expr, 0)