mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor property comparison in compute_property_patches
- Replaced direct comparison of snapshot and instance property values with a call to variant_eq for improved type safety and correctness in patch computation.
This commit is contained in:
parent
6f4a279254
commit
80b8331008
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ use rbx_dom_weak::{
|
||||||
ustr, HashMapExt as _, UstrMap, UstrSet,
|
ustr, HashMapExt as _, UstrMap, UstrSet,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{RojoRef, REF_PATH_ATTRIBUTE_PREFIX, REF_POINTER_ATTRIBUTE_PREFIX};
|
use crate::{variant_eq::variant_eq, RojoRef, REF_PATH_ATTRIBUTE_PREFIX, REF_POINTER_ATTRIBUTE_PREFIX};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
patch::{PatchAdd, PatchSet, PatchUpdate},
|
patch::{PatchAdd, PatchSet, PatchUpdate},
|
||||||
|
|
@ -127,7 +127,7 @@ fn compute_property_patches(
|
||||||
|
|
||||||
match instance.properties().get(&name) {
|
match instance.properties().get(&name) {
|
||||||
Some(instance_value) => {
|
Some(instance_value) => {
|
||||||
if &snapshot_value != instance_value {
|
if !variant_eq(&snapshot_value, instance_value) {
|
||||||
changed_properties.insert(name, Some(snapshot_value));
|
changed_properties.insert(name, Some(snapshot_value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue