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

Unified Diff: compiled/String.h

Issue 29587914: Issue 5142 - Convert Element Hiding to C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Re-added elemHide.js test. Fixed test failures related. Addresses review comments. Created Jan. 19, 2018, 2:02 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/Map.h ('k') | compiled/StringMap.h » ('j') | test/elemHide.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/String.h
===================================================================
--- a/compiled/String.h
+++ b/compiled/String.h
@@ -319,16 +319,29 @@
}
~OwnedString()
{
if (mBuf)
delete[] mBuf;
}
+ void reset(const String& str)
+ {
+ *this = str;
+ }
+
+ void erase()
+ {
+ if (mBuf)
+ delete[] mBuf;
+ mBuf = nullptr;
+ mLen = DELETED;
+ }
+
OwnedString& operator=(const String& str)
{
*this = OwnedString(str);
return *this;
}
OwnedString& operator=(const OwnedString& str)
{
« no previous file with comments | « compiled/Map.h ('k') | compiled/StringMap.h » ('j') | test/elemHide.js » ('J')

Powered by Google App Engine
This is Rietveld