From 8f4fb4a44c17c618564e7cdaaa6992dbf7a54815 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 6 Jul 2022 00:04:28 -0700 Subject: [PATCH] [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 --- Utils/SandboxBroker.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Utils/SandboxBroker.m b/Utils/SandboxBroker.m index 928d8afb2..3a10a2a2d 100644 --- a/Utils/SandboxBroker.m +++ b/Utils/SandboxBroker.m @@ -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:@"#"