commit | b263427c4710af9747f7136b55516297d9a23bf2 | [log] [tgz] |
---|---|---|
author | Android Build Role Account android-build-prod <android-build-team-robot@google.com> | Sat Feb 06 00:24:12 2021 +0000 |
committer | Android Build Role Account android-build-prod <android-build-team-robot@google.com> | Sat Feb 06 00:24:12 2021 +0000 |
tree | 948c9bc56f9ce16be561120f57f06102000cad52 | |
parent | 75abeea307eb398cb0bb375b8756cce6aa03af09 [diff] | |
parent | 97fbb31bb4ccb1c503d1986345ec7df9b801b9bb [diff] |
Snap for 7127838 from 97fbb31bb4ccb1c503d1986345ec7df9b801b9bb to s-keystone-qcom-release Change-Id: I750a3d62d3a455666b9b2fa388b206ca6385878e
"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();