commit | 186e8f9d6c52617caed1bcaa1e8892f3792710ca | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Thu Jul 11 16:17:05 2024 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Jul 11 16:17:05 2024 +0000 |
tree | 6efa95f63d3555804589e641ae94d9515d6276c9 | |
parent | 7c9a7bcf98727276aec7a793282027003f16fc14 [diff] | |
parent | 1b4e2e6247b38f4ad9ffad0b150eac269e4b912d [diff] |
Merge "Mark apex-available" into main
“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();