Skip to content

Commit 47382e2

Browse files
committed
NumberDate: inline always true condition
Remove the unnecessary condition which is always set to true.
1 parent 11adf74 commit 47382e2

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

CoreFoundation/NumberDate.subproj/CFTimeZone.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,6 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
11861186
}
11871187

11881188
CFStringRef tzName = NULL;
1189-
Boolean tryAbbrev = true;
11901189
CFURLRef baseURL, tempURL;
11911190
void *bytes;
11921191
CFIndex length;
@@ -1199,20 +1198,20 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
11991198
#else
12001199
baseURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, __tzZoneInfo, kCFURLPOSIXPathStyle, true);
12011200
#endif
1202-
if (tryAbbrev) {
1203-
CFDictionaryRef abbrevs = CFTimeZoneCopyAbbreviationDictionary();
1204-
tzName = CFDictionaryGetValue(abbrevs, name);
1205-
if (NULL != tzName) {
1206-
tempURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, tzName, false);
1207-
if (NULL != tempURL) {
1208-
if (_CFReadBytesFromFile(kCFAllocatorSystemDefault, tempURL, &bytes, &length, 0, 0)) {
1209-
data = CFDataCreateWithBytesNoCopy(kCFAllocatorSystemDefault, bytes, length, kCFAllocatorSystemDefault);
1210-
}
1211-
CFRelease(tempURL);
1201+
1202+
CFDictionaryRef abbrevs = CFTimeZoneCopyAbbreviationDictionary();
1203+
tzName = CFDictionaryGetValue(abbrevs, name);
1204+
if (NULL != tzName) {
1205+
tempURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, tzName, false);
1206+
if (NULL != tempURL) {
1207+
if (_CFReadBytesFromFile(kCFAllocatorSystemDefault, tempURL, &bytes, &length, 0, 0)) {
1208+
data = CFDataCreateWithBytesNoCopy(kCFAllocatorSystemDefault, bytes, length, kCFAllocatorSystemDefault);
12121209
}
1210+
CFRelease(tempURL);
12131211
}
1214-
CFRelease(abbrevs);
12151212
}
1213+
CFRelease(abbrevs);
1214+
12161215
if (NULL == data) {
12171216
CFDictionaryRef dict = __CFTimeZoneCopyCompatibilityDictionary();
12181217
CFStringRef mapping = CFDictionaryGetValue(dict, name);

0 commit comments

Comments
 (0)