Skip to content

Commit

Permalink
perf: use len instead of magic number when pre-allocating hashset
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Nov 25, 2024
1 parent 51c6986 commit ae5c394
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ fn dyn_enum_validator_factory<'a>(
};

// Read the first column into a HashSet
let mut enum_set = HashSet::with_capacity(50);
let mut enum_set = HashSet::with_capacity(lookup_result.headers.len());
let rconfig = Config::new(Some(lookup_result.filepath).as_ref());
let mut rdr = match rconfig
.flexible(true)
Expand Down

0 comments on commit ae5c394

Please sign in to comment.