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: Removed newValue and oldValue parameters Created April 15, 2017, 3:05 p.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
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;
}

Powered by Google App Engine
This is Rietveld