Index: compiled/String.h |
=================================================================== |
--- a/compiled/String.h |
+++ b/compiled/String.h |
@@ -17,19 +17,18 @@ |
#pragma once |
#include <algorithm> |
#include <cstddef> |
#include <cstring> |
#include <type_traits> |
-#include <emscripten.h> |
- |
#include "debug.h" |
+#include "library.h" |
inline void String_assert_readonly(bool readOnly); |
class String |
{ |
friend class DependentString; |
friend class OwnedString; |
@@ -183,21 +182,17 @@ public: |
value_type currChar = mBuf[i]; |
// This should be more efficient with a lookup table but I couldn't measure |
// any performance difference. |
if (currChar >= u'A' && currChar <= u'Z') |
mBuf[i] = currChar + u'a' - u'A'; |
else if (currChar >= 128) |
{ |
- // It seems that calling JS is the easiest solution for lowercasing |
- // Unicode characters. |
- mBuf[i] = EM_ASM_INT({ |
- return String.fromCharCode($0).toLowerCase().charCodeAt(0); |
- }, currChar); |
+ mBuf[i] = CharToLower(currChar); |
} |
} |
} |
}; |
class DependentString : public String |
{ |
public: |