commit | 2ce73eea87049957a7b48fc54bbc303fa3d57996 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Mar 08 15:44:45 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Mar 08 15:44:45 2023 +0000 |
tree | e7ccbbbfb133da56e0cac7a08cc21948ffe3ab7d | |
parent | d5e91b4b6da37af35d48de57f5387ef8f2b2471b [diff] | |
parent | c004a69014a9474ebfcfa357d7a3afefbf7d78bd [diff] |
Snap for 9710098 from c004a69014a9474ebfcfa357d7a3afefbf7d78bd to mainline-tzdata5-release Change-Id: Ide8e072ea2e262d552197931a9079237132152ac
“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();