Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2655)

Unified Diff: Source/wtf/text/WTFString.h

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebPopupMenuImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/WTFString.h
diff --git a/Source/wtf/text/WTFString.h b/Source/wtf/text/WTFString.h
index 7c2dffd226923a46e0e06d3c9b3aae7562624495..1e8388eca82d820b48e182861ba69c2c8b1bb555 100644
--- a/Source/wtf/text/WTFString.h
+++ b/Source/wtf/text/WTFString.h
@@ -621,7 +621,7 @@ template<size_t inlineCapacity>
inline void String::appendTo(Vector<UChar, inlineCapacity>& result, unsigned pos, unsigned len) const
{
unsigned numberOfCharactersToCopy = std::min(len, length() - pos);
- if (numberOfCharactersToCopy <= 0)
+ if (!numberOfCharactersToCopy)
return;
result.reserveCapacity(result.size() + numberOfCharactersToCopy);
if (is8Bit()) {
@@ -638,7 +638,7 @@ template<typename BufferType>
inline void String::appendTo(BufferType& result, unsigned pos, unsigned len) const
{
unsigned numberOfCharactersToCopy = std::min(len, length() - pos);
- if (numberOfCharactersToCopy <= 0)
+ if (!numberOfCharactersToCopy)
return;
if (is8Bit())
result.append(m_impl->characters8() + pos, numberOfCharactersToCopy);
@@ -650,7 +650,7 @@ template<size_t inlineCapacity>
inline void String::prependTo(Vector<UChar, inlineCapacity>& result, unsigned pos, unsigned len) const
{
unsigned numberOfCharactersToCopy = std::min(len, length() - pos);
- if (numberOfCharactersToCopy <= 0)
+ if (!numberOfCharactersToCopy)
return;
if (is8Bit()) {
size_t oldSize = result.size();
« no previous file with comments | « Source/web/WebPopupMenuImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698