File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -412,10 +412,13 @@ impl TransformForest {
412
412
413
413
// Common case: both source & target share the same root.
414
414
let result = if source. root == target. root {
415
- // TODO: fast track for root being target.
416
- // target_from_source = target_from_reference * root_from_source
417
- let target_from_source = root_from_source. left_multiply ( target. target_from_root ) ;
418
- Ok ( target_from_source)
415
+ if source. root == target. id {
416
+ // Fast track for source's root being the target.
417
+ Ok ( source. root_from_source . clone ( ) )
418
+ } else {
419
+ // target_from_source = target_from_reference * root_from_source
420
+ Ok ( root_from_source. left_multiply ( target. target_from_root ) )
421
+ }
419
422
}
420
423
// There might be a connection via a pinhole making this 3D in 2D.
421
424
else if let Some ( TransformTreeRootInfo :: Pinhole ( pinhole_tree_root) ) = target_root_info
You can’t perform that action at this time.
0 commit comments