language: Remove some unnecessary cloning (#30229)

Another tiny patch to reduce allocations

`.iter().cloned().collect()` calls `Clone` per element, whereas
`into_iter().collect()` preallocates memory

Release Notes:

- N/A
This commit is contained in:
tidely 2025-05-08 12:57:19 +02:00 committed by GitHub
parent d06d0e6a94
commit a61958e886
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2698,7 +2698,7 @@ impl Buffer {
}
self.send_operation(
Operation::UpdateCompletionTriggers {
triggers: triggers.iter().cloned().collect(),
triggers: triggers.into_iter().collect(),
lamport_timestamp: self.completion_triggers_timestamp,
server_id,
},