[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
Christopher Snowhill 2022-07-06 00:04:28 -07:00
parent 9bf5bbba80
commit 8f4fb4a44c
1 changed files with 0 additions and 6 deletions

View File

@ -99,12 +99,6 @@ static SandboxBroker *kSharedSandboxBroker = nil;
+ (NSURL *)urlWithoutFragment:(NSURL *)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];
NSRange fragmentRange = [s rangeOfString:@"#"