commit | 59be2372fd41d768906a1cdb29b56bd4147b2a1a | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Tue Jan 31 21:30:29 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jan 31 21:30:29 2023 +0000 |
tree | b5c8c51cb9dd1f2aaec7ac25763e728f3c379da5 | |
parent | 68572eff1d4ae3b2f92a299a50e618ee11ca968c [diff] | |
parent | daf9ec3a3e4037974a8b343267048faba26b16d4 [diff] |
Update TEST_MAPPING am: b9d5e9fc1a am: 497e98b0a0 am: daf9ec3a3e Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2411752 Change-Id: I40f21052d07612f4d9750f945ae599763a81d74a Signed-off-by: Automerger Merge Worker <[email protected]>
“Small vector” optimization for Rust: store up to a small number of items on the stack
use smallvec::{SmallVec, smallvec}; // This SmallVec can hold up to 4 items on the stack: let mut v: SmallVec<[i32; 4]> = smallvec![1, 2, 3, 4]; // It will automatically move its contents to the heap if // contains more than four items: v.push(5); // SmallVec points to a slice, so you can use normal slice // indexing and other methods to access its contents: v[0] = v[1] + v[2]; v.sort();