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

Unified Diff: base/hash.h

Issue 1916193003: Change SuperFastHash signature to use size_t, not int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | base/hash.cc » ('j') | no next file with comments »
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 97e251cdf1ed8031e1b1adc79d999fd10e303d39..7c0fba6d39e97a4b0d8a6faf9f43ab905310fc0b 100644
--- a/base/hash.h
+++ b/base/hash.h
@@ -18,16 +18,12 @@
namespace base {
// WARNING: This hash function should not be used for any cryptographic purpose.
-BASE_EXPORT uint32_t SuperFastHash(const char* data, int len);
+BASE_EXPORT uint32_t SuperFastHash(const char* data, size_t length);
// Computes a hash of a memory buffer |data| of a given |length|.
// WARNING: This hash function should not be used for any cryptographic purpose.
inline uint32_t Hash(const char* data, size_t length) {
- if (length > static_cast<size_t>(std::numeric_limits<int>::max())) {
- NOTREACHED();
- return 0;
- }
- return SuperFastHash(data, static_cast<int>(length));
+ return SuperFastHash(data, length);
}
// Computes a hash of a string |str|.
« no previous file with comments | « no previous file | base/hash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698