Skip to content

Commit

Permalink
refactor: opt code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoLei1990 committed Feb 6, 2025
1 parent 6aa622f commit 4532dbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,13 @@ export class Scene extends EngineObject {
return null;
}

Check warning on line 423 in packages/core/src/Scene.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/Scene.ts#L422-L423

Added lines #L422 - L423 were not covered by tests

const searchRootName = splits.shift();
for (let i = 0, n = this.rootEntitiesCount; i < n; i++) {
let rootEntity = this.getRootEntity(i);
if (rootEntity.name != searchRootName) {
continue;
}

const target = Entity._findChildByName(rootEntity, 0, splits, 0);
if (target) {
return target;
Expand Down

0 comments on commit 4532dbf

Please sign in to comment.