We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a9694d commit 0c44350Copy full SHA for 0c44350
Sources/CoreFoundation/CFURL.c
@@ -2375,13 +2375,7 @@ CFURLRef _CFURLCopyFileURL(CFURLRef url)
2375
// get just the component flag bits
2376
UInt32 flags = url->_flags & ALL_COMPONENTS_MASK;
2377
// get the rangeCount -- the number of component flag bits set
2378
- CFIndex rangeCount = 0;
2379
- while ( flags != 0 ) {
2380
- if ( flags & 1 ) {
2381
- ++rangeCount;
2382
- }
2383
- flags >>= 1;
2384
+ CFIndex rangeCount = __builtin_popcount(flags);
2385
result = _CFURLAlloc(allocator, rangeCount);
2386
if ( result ) {
2387
// copy the URL fields from _flags to _ranges
0 commit comments