Permalink
Browse files

minor refactoring

  • Loading branch information...
1 parent 05b5dfc commit f4039cc466c57ff8fe663bec2cf38d4511e3f441 @Machx committed Nov 29, 2012
Showing with 4 additions and 9 deletions.
  1. +2 −5 Source/CWDateUtilities.m
  2. +2 −4 Source/CWDebugUtilities.m
View
@@ -36,11 +36,8 @@ + (NSDate *) dateFromISO8601String:(NSString *)dateString
isoDate = [self dateFromString:dateString
withDateFormat:kCWISO8601TimeFormat];
- if (isoDate == nil)
- isoDate = [self dateFromString:dateString
- withDateFormat:kCWISO8601TimeFormat2];
-
- return isoDate;
+ return (isoDate ? isoDate : [self dateFromString:dateString
+ withDateFormat:kCWISO8601TimeFormat2]);
}
+ (NSDate *) dateFromString:(NSString *)dateString withDateFormat:(NSString *)dateFormat
@@ -91,12 +91,10 @@ void CWInDebugOnly(void(^DebugBlock)(void))
double CWMilliSecondsToExecuteCode(void(^TimeBlock)(void))
{
double result = CWNanoSecondsToExecuteCode(TimeBlock);
- double milliseconds = 1.0 * 10e-6 * result;
- return milliseconds;
+ return (1.0 * 10e-6 * result);
}
NSString *CWStackTrace(void)
{
- NSString *trace = [[NSThread callStackSymbols] description];
- return trace;
+ return [[NSThread callStackSymbols] description];
}

0 comments on commit f4039cc

Please sign in to comment.