Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/String.h

Issue 29425555: Issue 5201 - [emscripten] Replace EM_ASM calls by a custom JavaScript library (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Abstracted away all Emscripten dependencies Created May 3, 2017, 11:54 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/FilterNotifier.cpp ('k') | compiled/bindings/generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « compiled/FilterNotifier.cpp ('k') | compiled/bindings/generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld