From 7ba685c7abe3f4e76d7e720277c1070c4dafb88b Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Tue, 14 May 2013 20:32:49 +0200 Subject: Add inlining for iter_bytes for types used as hashmap keys Not inlining these affects the hash table performance quite badly. --- src/libsyntax/parse/token.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 27686c4e4aa..fe479ab81f7 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -357,12 +357,14 @@ impl<'self> Equiv<@~str> for StringRef<'self> { #[cfg(stage0)] impl<'self> to_bytes::IterBytes for StringRef<'self> { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f); } } #[cfg(not(stage0))] impl<'self> to_bytes::IterBytes for StringRef<'self> { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { (**self).iter_bytes(lsb0, f) } -- cgit 1.4.1-3-g733a5