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

Unified Diff: base/hash.h

Issue 181643004: Moved SuperFastHash function from base/hash.cc to base/third_party. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « base/base.gypi ('k') | base/hash.cc » ('j') | base/hash.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/hash.h
diff --git a/base/hash.h b/base/hash.h
index cf8ea3a26e49475a9187d7005cc17b0f470609f6..2a4c2ccdb59b8a8d6cb8a9c719384e85b4224955 100644
--- a/base/hash.h
+++ b/base/hash.h
@@ -10,11 +10,21 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#ifdef __cplusplus
rvargas (doing something else) 2014/02/27 04:11:20 Do we need this?
Matt Giuca 2014/02/27 04:24:09 Assuming you mean #ifdef __cplusplus as opposed to
+extern "C" {
+#endif
+
+// Definition in base/third_party/superfasthash/superfasthash.c. (Third-party
+// code did not come with its own header file, so declaring the function here.)
+uint32_t SuperFastHash(const char* data, int len);
+
+#ifdef __cplusplus
+}
+#endif
+
namespace base {
jln (very slow on Chromium) 2014/02/27 04:37:17 Please, make it very clear that none of these shou
Matt Giuca 2014/02/27 05:25:29 Done.
-// From http://www.azillionmonkeys.com/qed/hash.html
-// This is the hash used on WebCore/platform/stringhash
-BASE_EXPORT uint32 SuperFastHash(const char * data, int len);
+BASE_EXPORT uint32 SuperFastHash(const char* data, int len);
inline uint32 Hash(const char* key, size_t length) {
return SuperFastHash(key, static_cast<int>(length));
jln (very slow on Chromium) 2014/02/27 04:37:17 This cast is implementation defined for values str
Matt Giuca 2014/02/27 05:25:29 Done. (Note that the existing implementation does
« no previous file with comments | « base/base.gypi ('k') | base/hash.cc » ('j') | base/hash.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698