Skip to content

Commit

Permalink
Merge pull request #114 from lzutao/premature
Browse files Browse the repository at this point in the history
Some premature optimizations
  • Loading branch information
spastorino authored Oct 22, 2020
2 parents 50e8e29 + 8024b05 commit 9cc74c4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,16 +1056,19 @@ fn bisect_nightlies(cfg: &Config, client: &Client) -> Result<BisectionResult, Er
fn toolchains_between(cfg: &Config, a: ToolchainSpec, b: ToolchainSpec) -> Vec<Toolchain> {
match (a, b) {
(ToolchainSpec::Nightly { date: a }, ToolchainSpec::Nightly { date: b }) => {
let mut toolchains = Vec::new();
let size = (b - a).num_days() + 1;
assert!(size > 0);
let mut toolchains = Vec::with_capacity(size as usize);
let mut date = a;
let mut std_targets = vec![cfg.args.host.clone(), cfg.target.clone()];
std_targets.sort();
std_targets.dedup();
while date <= b {
let mut t = Toolchain {
let t = Toolchain {
spec: ToolchainSpec::Nightly { date },
host: cfg.args.host.clone(),
std_targets: vec![cfg.args.host.clone(), cfg.target.clone()],
std_targets: std_targets.clone(),
};
t.std_targets.sort();
t.std_targets.dedup();
toolchains.push(t);
date = date.succ();
}
Expand Down

0 comments on commit 9cc74c4

Please sign in to comment.