Skip to content

Commit 7ae813b

Browse files
committed
[Models] Use NSStringFromNSUInteger instead of stringWithFormat:
For performance improvements
1 parent 4593122 commit 7ae813b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

ClassDump/Models/ParseTypes/CDArrayType.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "CDArrayType.h"
10+
#import "../../Services/CDStringFormatting.h"
1011

1112
@implementation CDArrayType
1213

@@ -31,7 +32,7 @@ - (CDSemanticString *)semanticStringForVariableName:(NSString *)varName {
3132

3233
[arrayStack enumerateObjectsUsingBlock:^(CDArrayType *arrayType, NSUInteger idx, BOOL *stop) {
3334
[build appendString:@"[" semanticType:CDSemanticTypeStandard];
34-
[build appendString:[NSString stringWithFormat:@"%lu", (unsigned long)arrayType.size] semanticType:CDSemanticTypeNumeric];
35+
[build appendString:NSStringFromNSUInteger(arrayType.size) semanticType:CDSemanticTypeNumeric];
3536
[build appendString:@"]" semanticType:CDSemanticTypeStandard];
3637
}];
3738

ClassDump/Models/ParseTypes/CDBitFieldType.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "CDBitFieldType.h"
10+
#import "../../Services/CDStringFormatting.h"
1011

1112
@implementation CDBitFieldType
1213

@@ -66,7 +67,7 @@ - (CDSemanticString *)semanticStringForVariableName:(NSString *)varName {
6667
}
6768

6869
[build appendString:@" : " semanticType:CDSemanticTypeStandard];
69-
[build appendString:[NSString stringWithFormat:@"%lu", (unsigned long)self.width] semanticType:CDSemanticTypeNumeric];
70+
[build appendString:NSStringFromNSUInteger(self.width) semanticType:CDSemanticTypeNumeric];
7071
return build;
7172
}
7273

ClassDump/Models/Reflections/CDMethodModel.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import "CDMethodModel.h"
1010
#import "../../Services/CDTypeParser.h"
11+
#import "../../Services/CDStringFormatting.h"
1112

1213
/*
1314
* @APPLE_LICENSE_HEADER_START@
@@ -116,7 +117,7 @@ - (CDSemanticString *)semanticString {
116117
[build appendString:@"(" semanticType:CDSemanticTypeStandard];
117118
[build appendSemanticString:[argumentType semanticStringForVariableName:nil]];
118119
[build appendString:@")" semanticType:CDSemanticTypeStandard];
119-
[build appendString:[NSString stringWithFormat:@"a%lu", (unsigned long)idx] semanticType:CDSemanticTypeVariable];
120+
[build appendString:[@"a" stringByAppendingString:NSStringFromNSUInteger(idx)] semanticType:CDSemanticTypeVariable];
120121
if ((idx + 1) < argumentTypeCount) { // if there are still arguments left, add a space to separate
121122
[build appendString:@" " semanticType:CDSemanticTypeStandard];
122123
}

0 commit comments

Comments
 (0)