diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 20:32:49 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 20:32:49 +0200 |
| commit | 7ba685c7abe3f4e76d7e720277c1070c4dafb88b (patch) | |
| tree | 2834ea782163c29e96c7a8336a55625cc027b6d2 /src/libsyntax/parse | |
| parent | 767e3ae86cba26437a60009d79ac2a295b41768e (diff) | |
| download | rust-7ba685c7abe3f4e76d7e720277c1070c4dafb88b.tar.gz rust-7ba685c7abe3f4e76d7e720277c1070c4dafb88b.zip | |
Add inlining for iter_bytes for types used as hashmap keys
Not inlining these affects the hash table performance quite badly.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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) } |
