1
Fork 0

Rollup merge of #89072 - bjorn3:less_symbol_as_str, r=michaelwoerister

Avoid a couple of Symbol::as_str calls in cg_llvm

This should improve performance a tiny bit. Also remove `Symbol::len` and make `SymbolIndex` private.
This commit is contained in:
Jubilee 2021-09-24 11:40:12 -07:00 committed by GitHub
commit 8a454f8101
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 12 deletions

View file

@ -1618,7 +1618,7 @@ impl fmt::Display for MacroRulesNormalizedIdent {
pub struct Symbol(SymbolIndex);
rustc_index::newtype_index! {
pub struct SymbolIndex { .. }
struct SymbolIndex { .. }
}
impl Symbol {
@ -1644,10 +1644,6 @@ impl Symbol {
self.0.as_u32()
}
pub fn len(self) -> usize {
with_session_globals(|session_globals| session_globals.symbol_interner.get(self).len())
}
pub fn is_empty(self) -> bool {
self == kw::Empty
}