]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #50365 - nnethercote:nearest_common_ancestor-two-vecs, r=nikomatsakis
authorkennytm <kennytm@gmail.com>
Thu, 3 May 2018 08:11:31 +0000 (16:11 +0800)
committerkennytm <kennytm@gmail.com>
Thu, 3 May 2018 18:12:48 +0000 (02:12 +0800)
Use two vectors in nearest_common_ancestor.

When looking at any scope in scope chain A, we only need to look for
matches among scopes previously seen in scope chain B, and vice versa.
This halves the number of "seen before?" comparisons, speeding up some
runs of style-servo, clap-rs, and syn by 1--2%.

Thanks to @kirillkh for the suggestion.

r? @nikomatsakis


Trivial merge