diff options
| author | kennytm <kennytm@gmail.com> | 2018-05-23 00:26:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-23 00:26:21 +0800 |
| commit | e6495d12b6cbf334827212574e2689f6c7cf268f (patch) | |
| tree | 20fec27e35655ae336e25bfee3dd627078b720fc | |
| parent | 25a907dfb189205703206e5b2ed8811d76fa0b97 (diff) | |
| parent | 1fcb475271571659f15b7a47ef0d4de30d7cc680 (diff) | |
| download | rust-e6495d12b6cbf334827212574e2689f6c7cf268f.tar.gz rust-e6495d12b6cbf334827212574e2689f6c7cf268f.zip | |
Rollup merge of #50958 - KiChjang:nit-50697, r=pnkfelix
Micro-optimization on PR#50697 We should stop iterating through the indices in the `init_path_map` once we've already found a match for the local. r? @nikomatsakis or @pnkfelix
| -rw-r--r-- | src/librustc_mir/borrow_check/mod.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 5d6d4619c5e..4ec75d3b5ec 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -1853,6 +1853,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { for index in ii { if flow_state.ever_inits.contains(index) { self.used_mut.insert(*local); + break; } } } |
