Skip to content

Commit f1e9ccd

Browse files
committed
rbx_xml: directly build UstrMap for Instance.properties
1 parent c2f7b7f commit f1e9ccd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rbx_xml/src/deserializer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use ahash::{HashMap, HashMapExt, HashSet, HashSetExt};
44
use log::trace;
55
use rbx_dom_weak::{
66
types::{Ref, SharedString, Variant, VariantType},
7-
InstanceBuilder, Ustr, WeakDom,
7+
InstanceBuilder, Ustr, UstrMap, WeakDom,
88
};
99
use rbx_reflection::{DataType, PropertyKind, PropertySerialization, ReflectionDatabase};
1010

@@ -460,7 +460,7 @@ fn deserialize_instance<R: Read>(
460460
state.referents_to_ids.insert(referent, instance_id);
461461
}
462462

463-
let mut properties: HashMap<Ustr, Variant> = HashMap::new();
463+
let mut properties = UstrMap::new();
464464

465465
loop {
466466
match reader.expect_peek()? {
@@ -507,7 +507,7 @@ fn deserialize_instance<R: Read>(
507507
None => instance.class.to_string(),
508508
};
509509

510-
instance.properties = properties.into_iter().collect();
510+
instance.properties = properties;
511511

512512
Ok(())
513513
}
@@ -516,7 +516,7 @@ fn deserialize_properties<R: Read>(
516516
reader: &mut XmlEventReader<R>,
517517
state: &mut ParseState,
518518
instance_id: Ref,
519-
props: &mut HashMap<Ustr, Variant>,
519+
props: &mut UstrMap<Variant>,
520520
) -> Result<(), DecodeError> {
521521
reader.expect_start_with_name("Properties")?;
522522

0 commit comments

Comments
 (0)