mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
CR: fix early return, assert on error
inline functions which were only used once // FREEBIE
This commit is contained in:
parent
b4359b33dd
commit
da15f245cf
1 changed files with 7 additions and 13 deletions
|
@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
}
|
||||
|
||||
if (!isDirectory) {
|
||||
[self protectFileOrFolderAtPath:path];
|
||||
return [self protectFileOrFolderAtPath:path];
|
||||
}
|
||||
NSString *dirPath = path;
|
||||
|
||||
|
@ -58,17 +58,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return YES;
|
||||
}
|
||||
|
||||
+ (void)logAttributesOfItemAtPath:(NSString *)path
|
||||
{
|
||||
NSDictionary<NSFileAttributeKey, id> *_Nullable attributes = [self attributesOfItemAtPath:path];
|
||||
DDLogDebug(@"%@ path: %@ has attributes: %@", self.logTag, path, attributes);
|
||||
}
|
||||
|
||||
+ (nullable NSDictionary<NSFileAttributeKey, id> *)attributesOfItemAtPath:(NSString *)path
|
||||
{
|
||||
return [[NSFileManager defaultManager] attributesOfItemAtPath:path error:nil];
|
||||
}
|
||||
|
||||
+ (void)logAttributesOfItemAtPathRecursively:(NSString *)path
|
||||
{
|
||||
BOOL isDirectory;
|
||||
|
@ -81,7 +70,12 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
DDLogDebug(@"%@ path: %@ has attributes: %@", self.logTag, path, directoryEnumerator.fileAttributes);
|
||||
}
|
||||
} else {
|
||||
[self logAttributesOfItemAtPath:path];
|
||||
NSError *error;
|
||||
NSDictionary<NSFileAttributeKey, id> *_Nullable attributes =
|
||||
[[NSFileManager defaultManager] attributesOfItemAtPath:path error:error];
|
||||
OWSAssert(!error);
|
||||
|
||||
DDLogDebug(@"%@ path: %@ has attributes: %@", self.logTag, path, attributes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue