We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2db42fd commit 618d8e9Copy full SHA for 618d8e9
1 file changed
src/selection.rs
@@ -56,9 +56,9 @@ impl SelectionManager {
56
57
/// Sync the internal selection set to a Slint VecModel
58
pub fn sync_to_model(&self, model: &VecModel<i32>) {
59
- // Clear and repopulate to ensure exact match
+ // Clear by removing from the back to avoid O(n²) shifting
60
while model.row_count() > 0 {
61
- model.remove(0);
+ model.remove(model.row_count() - 1);
62
}
63
for &id in &self.selected {
64
model.push(id);
0 commit comments