mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix needless_late_init Clippy warning
This commit is contained in:
1 file changed
+3
-7
+3
-7
@@ -15,15 +15,11 @@ pub fn timing_safe_cmp(a: &[u8], b: &[u8]) -> bool {
|
||||
* chance to optimize and fold the code in any way that may change
|
||||
* the timing.
|
||||
*/
|
||||
let length: Volatile<usize>;
|
||||
let mut left: Volatile<*const u8>;
|
||||
let mut right: Volatile<*const u8>;
|
||||
let mut result: u8 = 0;
|
||||
|
||||
/* loop count depends on length of b */
|
||||
length = Volatile::new(len_b);
|
||||
left = Volatile::new(std::ptr::null());
|
||||
right = Volatile::new(b);
|
||||
let length: Volatile<usize> = Volatile::new(len_b);
|
||||
let mut left: Volatile<*const u8> = Volatile::new(std::ptr::null());
|
||||
let mut right: Volatile<*const u8> = Volatile::new(b);
|
||||
|
||||
/* don't use else here to keep the amount of CPU instructions constant,
|
||||
* volatile forces re-evaluation
|
||||
|
||||
Reference in new issue
Block a user