Implement some micro-optimizations for Identifier. NFC
Summary: Identifier doesn't maintain a length, so every time strref() is called, it does a strlen. In the case of comparisons, this isn't necessary: there is no need to scan a string to get its length, then rescan it to do the comparison. Just done one comparison. This also moves some assertions in Identifier::get as another microoptimization for 'assertions enabled' modes. Reviewers: rriddle! Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77958
Loading
Please sign in to comment