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

Unified Diff: compiled/String.h

Issue 29549903: Issue 5664 - assert now accept one parameter. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Leave assert() alone now. Created Sept. 21, 2017, 12:48 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
« no previous file with comments | « no previous file | compiled/StringMap.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
@@ -260,17 +260,17 @@
inline DependentString operator "" _str(const String::value_type* str,
String::size_type len)
{
return DependentString(str, len);
}
inline void String_assert_writable(bool isWritable)
{
- assert(isWritable, u"Writing access to a read-only string"_str);
+ assert2(isWritable, u"Writing access to a read-only string"_str);
}
class OwnedString : public String
{
private:
void grow(size_type additionalSize)
{
OwnedString newValue(length() + additionalSize);
@@ -343,28 +343,28 @@
return *this;
}
void append(const value_type* source, size_type sourceLen)
{
if (!sourceLen)
return;
- assert(source, u"Null buffer passed to OwnedString.append()"_str);
+ assert2(source, u"Null buffer passed to OwnedString.append()"_str);
size_t oldLength = length();
grow(sourceLen);
std::memcpy(mBuf + oldLength, source, sizeof(value_type) * sourceLen);
}
void append(const char* source, size_type sourceLen)
{
if (!sourceLen)
return;
- assert(source, u"Null buffer passed to OwnedString.append()"_str);
+ assert2(source, u"Null buffer passed to OwnedString.append()"_str);
size_t oldLength = length();
grow(sourceLen);
for (size_t i = 0; i < sourceLen; i++)
mBuf[oldLength + i] = source[i];
}
void append(const String& str)
{
« no previous file with comments | « no previous file | compiled/StringMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld