From: Jay Freeman (saurik) Date: Tue, 7 Dec 2010 10:18:46 +0000 (-0800) Subject: Add _unlikely() to conditions in -[Package unfiltered]. X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/fbfcc3a6306fe10b8b3f2e0f2ba1feca5734eec7 Add _unlikely() to conditions in -[Package unfiltered]. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 27562509..5f9e1d82 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 4f2169e4..c2412329 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)