mirror of
https://github.com/openharmony/third_party_rust_unicode-normalization.git
synced 2026-07-19 15:03:34 -04:00
41914c5d30
Having the Some() constructor in each match arm body puts extras stress on rustc's item_bodies_checking pass. We can work around that by moving the Some() constructor around the match, and directly returning None from the default arm, which is the only one that generates a None value. On my box, this almost cuts the time spent in item_bodies_checking in half, going from about 8.7s to about 4.6s, and reduces the complete compile time from about 13s to about 9s, so about a third less. There are no changes in performance in `cargo bench`. Note that doing the same for the composition_table() function does not yield any compile time wins, but would cause a performance regression. cc #29