mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 03:36:06 +00:00
Use InstanceBuilder::empty to avoid extra name allocations
This commit is contained in:
parent
d666634330
commit
85f113fcad
1 changed files with 3 additions and 2 deletions
|
|
@ -87,8 +87,9 @@ impl RojoTree {
|
|||
}
|
||||
|
||||
pub fn insert_instance(&mut self, parent_ref: Ref, snapshot: InstanceSnapshot) -> Ref {
|
||||
let builder = InstanceBuilder::new(snapshot.class_name.to_owned())
|
||||
.with_name(snapshot.name.to_owned())
|
||||
let builder = InstanceBuilder::empty()
|
||||
.with_class(snapshot.class_name.into_owned())
|
||||
.with_name(snapshot.name.into_owned())
|
||||
.with_properties(snapshot.properties);
|
||||
|
||||
let referent = self.inner.insert(parent_ref, builder);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue