Reuse Swig_string_mangle() instead of using Replaceall()

Use the same function in getNamespacedName() which was already used in
getGlobalWrapperName() just below, this is more readable and more clear
than just replacing dots with underscores as we did before.

Also use scoped_dohptr instead of manual Delete() calls.

No real changes.
This commit is contained in:
Vadim Zeitlin 2021-10-30 18:51:19 +02:00
commit d7f06c3721

View file

@ -189,10 +189,8 @@ public:
String *nspace = Getattr(n, "sym:nspace");
if (nspace) {
String *nspace_mangled = Copy(nspace);
Replaceall(nspace_mangled, ".", "_");
proxyname = NewStringf("%s_%s", nspace_mangled, symname);
Delete(nspace_mangled);
scoped_dohptr nspace_mangled(Swig_string_mangle(nspace));
proxyname = NewStringf("%s_%s", (DOH*)nspace_mangled, symname);
} else {
proxyname = Copy(symname);
}