commit | 31e381f1ca44a274eab579abb7b3444b06c2dd85 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Jun 01 22:50:22 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 01 22:50:22 2021 +0000 |
tree | 49b6ff005e50a5361a721ac1a73e84d5e4526af4 | |
parent | 3b9b331eff3a67bb2aca866839cae8049d9a30a0 [diff] | |
parent | ffe606899b9aa6df923397ef330fbaf67b4e3e4b [diff] |
Remove patch and use config file. am: 9aa887234f am: 7c49fca48b am: 9603682420 am: ffe606899b Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1723362 Change-Id: I748c83d5318809f959207717827487a9d85f60a4
"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();