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

Unified Diff: net/quic/congestion_control/cube_root.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « net/proxy/proxy_resolver_v8_tracing.cc ('k') | net/quic/congestion_control/cubic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/cube_root.cc
diff --git a/net/quic/congestion_control/cube_root.cc b/net/quic/congestion_control/cube_root.cc
index c563ad9cf5e2c916265f9903355306c0634ef9b8..191cccc1f9124cfee9d081c08b16942a6428707c 100644
--- a/net/quic/congestion_control/cube_root.cc
+++ b/net/quic/congestion_control/cube_root.cc
@@ -64,7 +64,7 @@ uint32 CubeRoot::Root(uint64 a) {
if (msb < 7) {
// MSB in our table.
- return ((cube_root_table[static_cast<uint32>(a)]) + 31) >> 6;
+ return ((cube_root_table[a]) + 31) >> 6;
}
// MSB 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ...
// cubic_shift 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, ...
@@ -72,9 +72,8 @@ uint32 CubeRoot::Root(uint64 a) {
cubic_shift = ((cubic_shift * 342) >> 10); // Div by 3, biased high.
// 4 to 6 bits accuracy depending on MSB.
- uint32 down_shifted_to_6bit = (a >> (cubic_shift * 3));
- uint64 root = ((cube_root_table[down_shifted_to_6bit] + 10) << cubic_shift)
- >> 6;
+ uint64 root =
+ ((cube_root_table[a >> (cubic_shift * 3)] + 10) << cubic_shift) >> 6;
// Make one Newton-Raphson iteration.
// Since x has an error (inaccuracy due to the use of fix point) we get a
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing.cc ('k') | net/quic/congestion_control/cubic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698