Micro optimize handling of prefix in get_mangled_type()
Don't bother with a bunch of Replaceall() calls if the prefix is empty to begin with, which is commonly the case. No real changes.
This commit is contained in:
parent
579c441aa9
commit
9615021a91
1 changed files with 12 additions and 11 deletions
|
|
@ -560,7 +560,6 @@ public:
|
|||
|
||||
String *get_mangled_type(SwigType *type_arg) {
|
||||
String *result = NewString("");
|
||||
SwigType *prefix = 0;
|
||||
SwigType *type = 0;
|
||||
SwigType *tdtype = SwigType_typedef_resolve_all(type_arg);
|
||||
if (tdtype)
|
||||
|
|
@ -584,16 +583,18 @@ public:
|
|||
type = Copy(type_arg);
|
||||
}
|
||||
|
||||
prefix = SwigType_prefix(type);
|
||||
Replaceall(prefix, ".", "");
|
||||
Replaceall(prefix, "const", "c");
|
||||
Replaceall(prefix, "volatile", "v");
|
||||
Replaceall(prefix, "a(", "a");
|
||||
Replaceall(prefix, "m(", "m");
|
||||
Replaceall(prefix, "q(", "");
|
||||
Replaceall(prefix, ")", "");
|
||||
Replaceall(prefix, " ", "");
|
||||
Printf(result, "%s", prefix);
|
||||
SwigType *prefix = SwigType_prefix(type);
|
||||
if (Len(prefix)) {
|
||||
Replaceall(prefix, ".", "");
|
||||
Replaceall(prefix, "const", "c");
|
||||
Replaceall(prefix, "volatile", "v");
|
||||
Replaceall(prefix, "a(", "a");
|
||||
Replaceall(prefix, "m(", "m");
|
||||
Replaceall(prefix, "q(", "");
|
||||
Replaceall(prefix, ")", "");
|
||||
Replaceall(prefix, " ", "");
|
||||
Printf(result, "%s", prefix);
|
||||
}
|
||||
|
||||
type = SwigType_base(type);
|
||||
if (SwigType_isbuiltin(type))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue