[Sandbox Broker] Greatly speed up path resolving
The fragment remover need not detect whether the given path is a folder or a file, as it is only removing hash marked fragments, not actually removing the entire filename if it's only a file and not a folder like the old versions used to. This greatly speeds up access, especially on network shares. Signed-off-by: Christopher Snowhill <kode54@gmail.com>xcode15
parent
9bf5bbba80
commit
8f4fb4a44c
|
@ -99,12 +99,6 @@ static SandboxBroker *kSharedSandboxBroker = nil;
|
||||||
+ (NSURL *)urlWithoutFragment:(NSURL *)url {
|
+ (NSURL *)urlWithoutFragment:(NSURL *)url {
|
||||||
if(![url isFileURL]) return url;
|
if(![url isFileURL]) return url;
|
||||||
|
|
||||||
NSNumber *isDirectory;
|
|
||||||
|
|
||||||
BOOL success = [url getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:nil];
|
|
||||||
|
|
||||||
if(success && [isDirectory boolValue]) return url;
|
|
||||||
|
|
||||||
NSString *s = [url path];
|
NSString *s = [url path];
|
||||||
|
|
||||||
NSRange fragmentRange = [s rangeOfString:@"#"
|
NSRange fragmentRange = [s rangeOfString:@"#"
|
||||||
|
|
Loading…
Reference in New Issue