Skip to content

Commit 31a9ba4

Browse files
committed
NumberDate: inline always true condition
Remove the unnecessary condition which is always set to true.
1 parent 8920038 commit 31a9ba4

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
@@ -1187,7 +1187,6 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
11871187

11881188
CFStringRef tzName = NULL;
11891189
CFDataRef data = NULL;
1190-
Boolean tryAbbrev = true;
11911190
CFURLRef baseURL, tempURL;
11921191
void *bytes;
11931192
CFIndex length;
@@ -1200,20 +1199,20 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
12001199
#else
12011200
baseURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, __tzZoneInfo, kCFURLPOSIXPathStyle, true);
12021201
#endif
1203-
if (tryAbbrev) {
1204-
CFDictionaryRef abbrevs = CFTimeZoneCopyAbbreviationDictionary();
1205-
tzName = CFDictionaryGetValue(abbrevs, name);
1206-
if (NULL != tzName) {
1207-
tempURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, tzName, false);
1208-
if (NULL != tempURL) {
1209-
if (_CFReadBytesFromFile(kCFAllocatorSystemDefault, tempURL, &bytes, &length, 0, 0)) {
1210-
data = CFDataCreateWithBytesNoCopy(kCFAllocatorSystemDefault, bytes, length, kCFAllocatorSystemDefault);
1211-
}
1212-
CFRelease(tempURL);
1202+
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);
12131210
}
1211+
CFRelease(tempURL);
12141212
}
1215-
CFRelease(abbrevs);
12161213
}
1214+
CFRelease(abbrevs);
1215+
12171216
if (NULL == data) {
12181217
CFDictionaryRef dict = __CFTimeZoneCopyCompatibilityDictionary();
12191218
CFStringRef mapping = CFDictionaryGetValue(dict, name);

0 commit comments

Comments
 (0)