commit | ee9557888558608f55bc31f8f75006d3a209c390 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Thu Jun 16 00:20:53 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Jun 16 00:20:53 2022 +0000 |
tree | e3c3e822585ae016995730950b05fc47a5c680f2 | |
parent | 8da91ba18c7d8f5d6cd64fc0b96fe73b14e80e08 [diff] | |
parent | b3ddaf1ee44260dd6cad3c6d411f85e50e918ea2 [diff] |
Merge "Update TEST_MAPPING" am: 90306cd26c am: c9bc811d1e am: 7245e74ced am: 51c8542cbe am: b3ddaf1ee4 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2125578 Change-Id: I18dacad390de69b59e74795da3c30b297748d8d7 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();