Browse files

Simpler code to cheer up the analyzer

  • Loading branch information...
1 parent 6648360 commit 1839046f88b1ee1c17ac6ff26644d723a8a52760 @mikeabdullah mikeabdullah committed Jan 21, 2012
Showing with 6 additions and 9 deletions.
  1. +6 −9 KSPathUtilities.m
View
15 KSPathUtilities.m
@@ -60,23 +60,20 @@ + (NSString *)ks_stringWithPath:(NSString *)path relativeToDirectory:(NSString *
- (NSString *)ks_stringWithPathSuffix:(NSString *)aString;
{
- NSString *result = self;
-
NSString *extension = [self pathExtension];
if ([extension length])
{
- result = [[[self
- stringByDeletingPathExtension]
- stringByAppendingString:aString]
- stringByAppendingPathExtension:extension];
+ NSString *result = [[[self
+ stringByDeletingPathExtension]
+ stringByAppendingString:aString]
+ stringByAppendingPathExtension:extension];
+ return result;
}
else
{
// It's possible that the extension-less path ends with a slash. They need to be stripped
- result = [[self ks_standardizedPOSIXPath] stringByAppendingString:aString];
+ return [[self ks_standardizedPOSIXPath] stringByAppendingString:aString];
}
-
- return result;
}
- (NSString *)ks_stringByIncrementingPath;

0 comments on commit 1839046

Please sign in to comment.