commit | c00dd13f1110b0d93938c08d99a9d6bc4209778d | [log] [tgz] |
---|---|---|
author | Elisei Zamakhov <elisei@google.com> | Thu Jul 11 16:01:43 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jul 11 16:01:43 2024 +0000 |
tree | 6efa95f63d3555804589e641ae94d9515d6276c9 | |
parent | 4f277b70dc1536d099ad9020f1f9edb04c0f44de [diff] | |
parent | 7c9a7bcf98727276aec7a793282027003f16fc14 [diff] |
Mark apex-available am: 7c9a7bcf98 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/3166942 Change-Id: Iea1e28f3908209204864eae3ce9eeca113ec8039 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();