commit | daf9ec3a3e4037974a8b343267048faba26b16d4 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Tue Jan 31 19:33:32 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jan 31 19:33:32 2023 +0000 |
tree | b5c8c51cb9dd1f2aaec7ac25763e728f3c379da5 | |
parent | 33166182c2f5674be27ae1b6e1615a2ec813de7c [diff] | |
parent | 497e98b0a08cdbb8b050713c1c1df2f34417a39b [diff] |
Update TEST_MAPPING am: b9d5e9fc1a am: 497e98b0a0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2411752 Change-Id: Ib07a0b3cd44a7f7f25211fcaef2f11b975f052f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
“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();