summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-mangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-mangle.cpp')
-rw-r--r--source/slang/slang-mangle.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp
index 3b65d196d..b0568994f 100644
--- a/source/slang/slang-mangle.cpp
+++ b/source/slang/slang-mangle.cpp
@@ -83,11 +83,13 @@ namespace Slang
//
for (auto c : str)
{
- if (('a' <= c) && (c <= 'z')) { encoded.append(c); }
- if (('A' <= c) && (c <= 'Z')) { encoded.append(c); }
- if (('0' <= c) && (c <= '9')) { encoded.append(c); }
-
- if (c == '_')
+ if (('a' <= c) && (c <= 'z')
+ || ('A' <= c) && (c <= 'Z')
+ || ('0' <= c) && (c <= '9'))
+ {
+ encoded.append(c);
+ }
+ else if (c == '_')
{
encoded.append("_u");
}