same-item-push Prefer bulk initialization over repeatedly pushing one invariant value A counted loop that only pushes one invariant value repeatedly grows and initializes a collection element by element. Instead, you SHOULD use bulk repeated initialization or resize the collection once. - Category: performance - Level: warning - Fix: none - Scope: module Reported function append(values: int32[], count: isize): void { for (const _ of 0..count) { values.push(0); } } Accepted function append(values: int32[], count: isize): void { if (count > 0) { values.resize(values.length + count, 0); } } Prior art - Clippy ยท sameitempush language/linter/src/rules/performance/sameitempush.rs:6