summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-18 10:22:45 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-11-18 10:22:45 -0800
commit1c1dfc2dd3287a2b1da5dcdc53c835d67621029c (patch)
tree50639f4d5be71c274578c874ccbef7cbdf33146d
parent36fbb2aa674449142ed68cf656222d9f6da16c27 (diff)
Remove StripVersion(), inlining the code to the one place it is used.
-rw-r--r--MobileCydia.mm15
1 files changed, 3 insertions, 12 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 68fc710..0208bad 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1075,23 +1075,13 @@ NSString *SizeString(double size) {
return [NSString stringWithFormat:@"%s%.1f %s", (negative ? "-" : ""), size, powers_[power]];
}
-const char *StripVersion_(const char *version) {
+static _finline const char *StripVersion_(const char *version) {
const char *colon(strchr(version, ':'));
if (colon != NULL)
version = colon + 1;
return version;
}
-// XXX: rename this to involve "Create"
-CFStringRef StripVersion(const char *version) {
- const char *colon(strchr(version, ':'));
- if (colon != NULL)
- version = colon + 1;
- return CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const uint8_t *>(version), strlen(version), kCFStringEncodingUTF8, NO);
- // XXX: performance
- return CYStringCreate(version);
-}
-
NSString *LocalizeSection(NSString *section) {
static Pcre title_r("^(.*?) \\((.*)\\)$");
if (title_r(section)) {
@@ -2104,7 +2094,8 @@ struct PackageNameOrdering :
database_ = database;
_profile(Package$initWithVersion$Latest)
- latest_ = (NSString *) StripVersion(version_.VerStr());
+ const char *latest(StripVersion_(version_.VerStr()));
+ latest_ = (NSString *) CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast<const uint8_t *>(latest), strlen(latest), kCFStringEncodingASCII, NO);
_end
pkgCache::VerIterator current;