]> git.lizzy.rs Git - rust.git/commit
rustc::hir::map::definitions - fix O(n^2) when disambiguating
authorAriel Ben-Yehuda <ariel.byd@gmail.com>
Tue, 1 Aug 2017 11:44:20 +0000 (14:44 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Tue, 1 Aug 2017 11:44:20 +0000 (14:44 +0300)
commit70478ca5c83513beb91cce78ae57ade70849fca4
treedfc64171f8e200c2c60557355f1be6a015aafcb5
parentc9d14a846f4e34d2cf0db89423a32428ad8e924f
rustc::hir::map::definitions - fix O(n^2) when disambiguating

Instead of finding the next free disambiguator by incrementing it until
you find a place, store the next available disambiguator in an hash-map.

This avoids O(n^2) performance when lots of items have the same
un-disambiguated `DefPathData` - e.g. all `use` items have
`DefPathData::Misc`.
src/librustc/hir/map/definitions.rs