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

Unified Diff: Source/wtf/Vector.h

Issue 332113002: VectorComparer should check null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add tests Created 6 years, 6 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 | « no previous file | Source/wtf/VectorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Vector.h
diff --git a/Source/wtf/Vector.h b/Source/wtf/Vector.h
index ed58774fe7f2980cc6b536181da877dc8b28fb81..7c0d0af1d3db8f420377b86e5b8809ace6839eb1 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -224,7 +224,9 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
{
static bool compare(const T* a, const T* b, size_t size)
{
- return std::equal(a, a + size, b);
+ if (LIKELY(a && b))
+ return std::equal(a, a + size, b);
+ return !a && !b;
}
};
« no previous file with comments | « no previous file | Source/wtf/VectorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698