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

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: 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') | Source/wtf/VectorTest.cpp » ('J')
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..210e2a9abb021125c06eefcd3e6c9e03b5c61fd9 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -224,6 +224,11 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
{
static bool compare(const T* a, const T* b, size_t size)
{
+ if (!a || !b) {
tkent 2014/06/16 04:42:26 I recommend to write popular case at first. e.g.
yoichio 2014/06/16 04:58:45 Done.
+ if (!a && !b)
+ return true;
+ return false;
+ }
return std::equal(a, a + size, b);
}
};
« no previous file with comments | « no previous file | Source/wtf/VectorTest.cpp » ('j') | Source/wtf/VectorTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698