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

Unified Diff: base/rand_util.cc

Issue 140773006: Improve base::RandBytes() performance by 1.75x-2.10x on POSIX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. 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 | « no previous file | base/rand_util_nacl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/rand_util.cc
diff --git a/base/rand_util.cc b/base/rand_util.cc
index 9641ff4f9c7c4ffe87aa5c7af7f9918d498799c4..1525b91449d438089a67b89f23521941a80e4500 100644
--- a/base/rand_util.cc
+++ b/base/rand_util.cc
@@ -61,16 +61,6 @@ uint64 RandGenerator(uint64 range) {
return value % range;
}
-void RandBytes(void* output, size_t output_length) {
- uint64 random_int;
- size_t random_int_size = sizeof(random_int);
- for (size_t i = 0; i < output_length; i += random_int_size) {
- random_int = base::RandUint64();
- size_t copy_count = std::min(output_length - i, random_int_size);
- memcpy(((uint8*)output) + i, &random_int, copy_count);
- }
-}
-
std::string RandBytesAsString(size_t length) {
DCHECK_GT(length, 0u);
std::string result;
« no previous file with comments | « no previous file | base/rand_util_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698