commit | 8464974135dd56db28e22a55b8af3a0a01a8b6f6 | [log] [tgz] |
---|---|---|
author | Roopa Sattiraju <[email protected]> | Wed Dec 22 17:06:38 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Dec 22 17:06:38 2021 +0000 |
tree | a3a1376bc898f7520a54af076af0a6c41706cc29 | |
parent | 4541755b559c0926e02c8eca7045d92d3ef4c1bb [diff] | |
parent | c88ecc614cd11e05d6e0cd1dc9b93a5a48c5fccc [diff] |
Adding bluetooth apex am: c88ecc614c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1931446 Change-Id: I1e9c2a1f48d55a39cd02e7201468a4f2d1b4d83f
“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();