Avoid unnecessary allocation
This commit is contained in:
parent
2c71c20f20
commit
6142179e31
|
@ -238,11 +238,10 @@ impl MemoryRegion {
|
|||
}
|
||||
|
||||
pub fn update(&self, data: &[u8]) {
|
||||
let gens: Vec<u64> = self
|
||||
let gens = self
|
||||
.gens
|
||||
.iter()
|
||||
.map(|i| i.load(std::sync::atomic::Ordering::Acquire))
|
||||
.collect();
|
||||
.each_ref()
|
||||
.map(|i| i.load(std::sync::atomic::Ordering::Acquire));
|
||||
let next_gen = gens.iter().max().unwrap() + 1;
|
||||
let indices = gens
|
||||
.into_iter()
|
||||
|
|
Loading…
Reference in New Issue