commit | 8da91ba18c7d8f5d6cd64fc0b96fe73b14e80e08 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Tue May 31 19:06:26 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue May 31 19:06:26 2022 +0000 |
tree | 50eda7edf9ae0374b69141200860fcae20ee6799 | |
parent | e28e0337db2443189336e5e4f64d19e671bd7229 [diff] | |
parent | f280663077822324fcde8f87a04e4a0b0b88622a [diff] |
Update TEST_MAPPING am: d7bd97eae4 am: 871eb4c7c3 am: d001883707 am: 97bd0f4a07 am: f280663077 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2108153 Change-Id: Id129059151daf39f7d604acb68c93eb148be1bf1 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();