|
|
@@ -300,8 +300,7 @@ impl BridgeAuth {
|
|
|
bridges: [BridgeLine; MAX_BRIDGES_PER_BUCKET],
|
|
|
bdb: &mut BridgeDb,
|
|
|
) {
|
|
|
- let bnum: u32;
|
|
|
- bnum = self.bridge_table.new_bucket(&bridges);
|
|
|
+ let bnum = self.bridge_table.new_bucket(&bridges);
|
|
|
let mut single = [BridgeLine::default(); MAX_BRIDGES_PER_BUCKET];
|
|
|
for b in bridges.iter() {
|
|
|
single[0] = *b;
|
|
|
@@ -313,8 +312,7 @@ impl BridgeAuth {
|
|
|
|
|
|
/// Insert a hot spare bucket of bridges
|
|
|
pub fn add_spare_bucket(&mut self, bucket: [BridgeLine; MAX_BRIDGES_PER_BUCKET]) {
|
|
|
- let bnum: u32;
|
|
|
- bnum = self.bridge_table.new_bucket(&bucket);
|
|
|
+ let bnum = self.bridge_table.new_bucket(&bucket);
|
|
|
self.bridge_table.spares.insert(bnum);
|
|
|
}
|
|
|
|
|
|
@@ -468,7 +466,7 @@ impl BridgeAuth {
|
|
|
}
|
|
|
}
|
|
|
for (bucketnum, offset) in positions.iter() {
|
|
|
- let mut bridgelines = match self.bridge_table.buckets.get(&bucketnum) {
|
|
|
+ let mut bridgelines = match self.bridge_table.buckets.get(bucketnum) {
|
|
|
Some(bridgelines) => *bridgelines,
|
|
|
None => return ReplaceSuccess::NotReplaced,
|
|
|
};
|
|
|
@@ -493,7 +491,7 @@ impl BridgeAuth {
|
|
|
}
|
|
|
None => return res,
|
|
|
};
|
|
|
- return res;
|
|
|
+ res
|
|
|
}
|
|
|
|
|
|
/// Mark a bridge as unreachable
|
|
|
@@ -526,7 +524,7 @@ impl BridgeAuth {
|
|
|
if let Some(v) = positions {
|
|
|
for (bucketnum, offset) in v.iter() {
|
|
|
// Count how many bridges in this bucket are reachable
|
|
|
- let mut bucket = match self.bridge_table.buckets.get(&bucketnum) {
|
|
|
+ let mut bucket = match self.bridge_table.buckets.get(bucketnum) {
|
|
|
Some(bridgelines) => *bridgelines,
|
|
|
None => return false,
|
|
|
};
|