]> git.lizzy.rs Git - rust.git/commitdiff
Update library/alloc/src/collections/vec_deque.rs
authorBraden Nelson <moonheart08@users.noreply.github.com>
Tue, 8 Sep 2020 18:11:08 +0000 (13:11 -0500)
committerGitHub <noreply@github.com>
Tue, 8 Sep 2020 18:11:08 +0000 (13:11 -0500)
Replace lshift with multiply

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
library/alloc/src/collections/vec_deque.rs

index 664ba48fcf565b3cc478e6a8999fac9d4871cfc1..f7f488f2f07169d2fefd442e87ffc36eb54a14b2 100644 (file)
@@ -33,7 +33,7 @@
 const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
 const MINIMUM_CAPACITY: usize = 1; // 2 - 1
 
-const MAXIMUM_ZST_CAPACITY: usize = 1 << ((core::mem::size_of::<usize>() << 3) - 1); // Largest possible power of two
+const MAXIMUM_ZST_CAPACITY: usize = 1 << (core::mem::size_of::<usize>() * 8 - 1); // Largest possible power of two
 
 /// A double-ended queue implemented with a growable ring buffer.
 ///