commit | 4f277b70dc1536d099ad9020f1f9edb04c0f44de | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed May 22 23:28:09 2024 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed May 22 23:28:09 2024 +0000 |
tree | 7872e8d542897450d9a437be1d1a3c7308e08b19 | |
parent | 9a30136c1d4f0aea393b7696559bd8424a37af11 [diff] | |
parent | 4d3d01ed9d6d33b3047d168963812170b7b9b1c9 [diff] |
Update Android.bp by running cargo_embargo am: 5edf2a06f2 am: 4d3d01ed9d Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/3096088 Change-Id: I6952c1bcc1027734719232d6566f79b8395eec7e 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();