commit | d27b37abcb00b6ed5ea67fe5b9a37dd0af22d5fc | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Aug 24 20:21:09 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 24 20:21:09 2021 +0000 |
tree | 0c9124e5458bc7501f3104afc5f4bdf2e0db1bd1 | |
parent | 13b8b26dc76cd7d87a7244817729d52c06caf17f [diff] | |
parent | cd274953a0ff0e56b689fbeede644309716e7714 [diff] |
Update TEST_MAPPING am: 703b0af731 am: 90cb51a2e0 am: 749c533042 am: dd7deac4d6 am: cd274953a0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1806171 Change-Id: I386fb7219fe4f825a30c068bd05307d34526d696
"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();