Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid overwriting id when diffing children #187

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/src/widget/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
self.children.truncate(new_children.len());
}

let len_changed = self.children.len() != new_children.len();

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / widget

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / web

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / all

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / wasm

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / wasm

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / web

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / widget

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / all

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / wasm

unused variable: `len_changed`

Check warning on line 294 in core/src/widget/tree.rs

View workflow job for this annotation

GitHub Actions / wasm

unused variable: `len_changed`

let children_len = self.children.len();
let (mut id_map, mut id_list): (
Expand Down Expand Up @@ -334,9 +334,6 @@
)
{
let c = &mut id_list[child_state_i];
if len_changed {
c.id.clone_from(new_id);
}
child_state_i += 1;
c
} else {
Expand Down
Loading