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
This commit is contained in:
kennytm 2018-05-23 00:26:21 +08:00 committed by GitHub
commit e6495d12b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}
}