Skip to content

Commit

Permalink
chore: use Default for cache object (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain authored Nov 9, 2024
1 parent 206dec2 commit d1d5885
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/calculate/pass_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const OPERATOR_HAS_PENALTY: [EffectOperator; 5] = [

pub struct PassThree {}

#[derive(Default)]
struct Cache {
hull: BTreeMap<i32, f64>,
char: BTreeMap<i32, f64>,
Expand Down Expand Up @@ -256,15 +257,7 @@ impl Item {

impl Pass for PassThree {
fn pass(info: &impl Info, ship: &mut Ship) {
let mut cache = Cache {
hull: BTreeMap::new(),
char: BTreeMap::new(),
structure: BTreeMap::new(),
target: BTreeMap::new(),
items: BTreeMap::new(),
charge: BTreeMap::new(),
skills: BTreeMap::new(),
};
let mut cache = Cache::default();

ship.hull
.calculate_values(info, ship, &mut cache, Object::Ship);
Expand Down

0 comments on commit d1d5885

Please sign in to comment.