commit | 377d7968af50692b4e2c43e45ff5d744e6a3d54a | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 28 16:01:14 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Apr 28 16:01:14 2022 +0000 |
tree | da86de748981dd96113865df11834b360d9da02b | |
parent | c5165f50fed34a1df4e5cf8cdc1f8972c9f0ca25 [diff] | |
parent | 638d0ee87b2ef1082fe674e75f89932b179fe32a [diff] |
Snap for 8512216 from 638d0ee87b2ef1082fe674e75f89932b179fe32a to tm-frc-scheduling-release Change-Id: Ia495cd9cbcefac18df8321a403d7e204cd6768e7
“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();