From d73509082b2a235022ecf4550c9140c253e01ab4 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Sat, 29 Jun 2019 19:20:59 +0200 Subject: [PATCH] Update lib.rs This is crucial for eliding bounds checks and makes a measurable performance difference, even for _simple function that would get two copies this way --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index d201937..56ea1f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,6 +110,7 @@ pub fn rle_decode_simple( /// /// Note that the generic bounds were replaced by an explicit a..b range. /// This is so that we can compile this on older toolchains (< 1.28). +#[inline(always)] fn append_from_within(seif: &mut Vec, src: ops::Range) where T: Copy, { assert!(src.start <= src.end, "src end is before src start"); assert!(src.end <= seif.len(), "src is out of bounds");