commit | 5b78872aec6d8315795b59da1558ea0f59523353 | [log] [tgz] |
---|---|---|
author | Karsten Tausche <karsten@fairphone.com> | Wed Dec 07 09:05:38 2022 +0100 |
committer | Karsten Tausche <karsten@fairphone.com> | Wed Dec 07 09:05:38 2022 +0100 |
tree | da86de748981dd96113865df11834b360d9da02b | |
parent | c3e5b09826dcf15acbe05a8b7941bc6aa0494026 [diff] | |
parent | 6121f74b640ff7bd25f8ac0638ae48fe122761d1 [diff] |
Merge tag 'android-13.0.0_r16' into int/13/fp3 Android 13.0.0 Release 16 (TQ1A.221205.011) * tag 'android-13.0.0_r16': Change-Id: I3e5a21f833731cc72bcbf6e497f728cd759ed59c
"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();