Remove needless range loops
This commit is contained in:
parent
3136a8ba85
commit
67639e2f11
|
@ -29,10 +29,11 @@ impl LoxServerContext {
|
|||
pub fn remove_extra_bridges(&self) -> [BridgeLine; MAX_BRIDGES_PER_BUCKET] {
|
||||
let mut extra_bridges = self.extra_bridges.lock().unwrap();
|
||||
let mut return_bridges = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET];
|
||||
for i in 0..MAX_BRIDGES_PER_BUCKET {
|
||||
return_bridges[i] = extra_bridges.remove(i);
|
||||
for bridge in return_bridges.iter_mut() {
|
||||
if let Some(extra) = extra_bridges.pop() {
|
||||
*bridge = extra
|
||||
}
|
||||
}
|
||||
|
||||
return_bridges
|
||||
}
|
||||
|
||||
|
|
|
@ -344,8 +344,8 @@ impl BridgeAuth {
|
|||
}
|
||||
while self.bridge_table.unallocated_bridges.len() >= MAX_BRIDGES_PER_BUCKET {
|
||||
let mut bucket = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET];
|
||||
for i in 0..MAX_BRIDGES_PER_BUCKET {
|
||||
bucket[i] = self.bridge_table.unallocated_bridges.pop().unwrap();
|
||||
for bridge in bucket.iter_mut() {
|
||||
*bridge = self.bridge_table.unallocated_bridges.pop().unwrap();
|
||||
}
|
||||
self.add_openinv_bridges(bucket, bdb);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue