Skip to content

Commit 66a4569

Browse files
committed
rbx_xml: directly build UstrMap for Instance.properties
1 parent c550476 commit 66a4569

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},
7-
InstanceBuilder, Ustr, WeakDom,
7+
InstanceBuilder, Ustr, UstrMap, WeakDom,
88
};
99
use rbx_reflection::{PropertyKind, PropertySerialization, ReflectionDatabase};
1010

@@ -492,7 +492,7 @@ fn deserialize_instance<R: Read>(
492492
state.referents_to_ids.insert(referent, instance_id);
493493
}
494494

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

497497
loop {
498498
match reader.expect_peek()? {
@@ -539,7 +539,7 @@ fn deserialize_instance<R: Read>(
539539
None => instance.class.to_string(),
540540
};
541541

542-
instance.properties = properties.into_iter().collect();
542+
instance.properties = properties;
543543

544544
Ok(())
545545
}
@@ -548,7 +548,7 @@ fn deserialize_properties<R: Read>(
548548
reader: &mut XmlEventReader<R>,
549549
state: &mut ParseState,
550550
instance_id: Ref,
551-
props: &mut HashMap<Ustr, Variant>,
551+
props: &mut UstrMap<Variant>,
552552
) -> Result<(), DecodeError> {
553553
reader.expect_start_with_name("Properties")?;
554554

0 commit comments

Comments
 (0)