We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a9b69b commit 2d71bb9Copy full SHA for 2d71bb9
CoreFoundation/URL.subproj/CFURL.c
@@ -2381,13 +2381,7 @@ CFURLRef _CFURLCopyFileURL(CFURLRef url)
2381
// get just the component flag bits
2382
UInt32 flags = url->_flags & ALL_COMPONENTS_MASK;
2383
// get the rangeCount -- the number of component flag bits set
2384
- CFIndex rangeCount = 0;
2385
- while ( flags != 0 ) {
2386
- if ( flags & 1 ) {
2387
- ++rangeCount;
2388
- }
2389
- flags >>= 1;
2390
+ CFIndex rangeCount = __builtin_popcount(flags);
2391
result = _CFURLAlloc(allocator, rangeCount);
2392
if ( result ) {
2393
// copy the URL fields from _flags to _ranges
0 commit comments