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 *get_mangled_type(SwigType *type_arg) {
|
||||||
String *result = NewString("");
|
String *result = NewString("");
|
||||||
SwigType *prefix = 0;
|
|
||||||
SwigType *type = 0;
|
SwigType *type = 0;
|
||||||
SwigType *tdtype = SwigType_typedef_resolve_all(type_arg);
|
SwigType *tdtype = SwigType_typedef_resolve_all(type_arg);
|
||||||
if (tdtype)
|
if (tdtype)
|
||||||
|
|
@ -584,16 +583,18 @@ public:
|
||||||
type = Copy(type_arg);
|
type = Copy(type_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix = SwigType_prefix(type);
|
SwigType *prefix = SwigType_prefix(type);
|
||||||
Replaceall(prefix, ".", "");
|
if (Len(prefix)) {
|
||||||
Replaceall(prefix, "const", "c");
|
Replaceall(prefix, ".", "");
|
||||||
Replaceall(prefix, "volatile", "v");
|
Replaceall(prefix, "const", "c");
|
||||||
Replaceall(prefix, "a(", "a");
|
Replaceall(prefix, "volatile", "v");
|
||||||
Replaceall(prefix, "m(", "m");
|
Replaceall(prefix, "a(", "a");
|
||||||
Replaceall(prefix, "q(", "");
|
Replaceall(prefix, "m(", "m");
|
||||||
Replaceall(prefix, ")", "");
|
Replaceall(prefix, "q(", "");
|
||||||
Replaceall(prefix, " ", "");
|
Replaceall(prefix, ")", "");
|
||||||
Printf(result, "%s", prefix);
|
Replaceall(prefix, " ", "");
|
||||||
|
Printf(result, "%s", prefix);
|
||||||
|
}
|
||||||
|
|
||||||
type = SwigType_base(type);
|
type = SwigType_base(type);
|
||||||
if (SwigType_isbuiltin(type))
|
if (SwigType_isbuiltin(type))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue