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

Unified Diff: compiled/String.h

Issue 29398669: Issue 5063 - [emscripten] Make FilterNotifier calls more efficient (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Addressed comments Created April 20, 2017, 8 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.cpp » ('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
@@ -108,16 +108,26 @@ public:
bool equals(const String& other) const
{
if (length() != other.length())
return false;
return std::memcmp(mBuf, other.mBuf, sizeof(value_type) * length()) == 0;
}
+ bool operator==(const String& other) const
+ {
+ return equals(other);
+ }
+
+ bool operator!=(const String& other) const
+ {
+ return !equals(other);
+ }
+
size_type find(value_type c, size_type pos = 0) const
{
for (size_type i = pos; i < length(); ++i)
if (mBuf[i] == c)
return i;
return npos;
}
« no previous file with comments | « compiled/FilterNotifier.cpp ('k') | compiled/bindings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld