优化代码。

This commit is contained in:
2024-05-28 09:41:07 +08:00
parent 33b271ddbe
commit 245c31bdce
3 changed files with 7 additions and 9 deletions

View File

@@ -124,10 +124,8 @@ class MenuList extends Menu {
}
static MenuList of(String parentMenuCode, String menuCode, String title, Iterable<Menu> children, int orderNum) {
MenuList instance = of(parentMenuCode, menuCode, title, orderNum);
for (Menu child : children) {
instance.addChild(child);
}
final MenuList instance = of(parentMenuCode, menuCode, title, orderNum);
children.forEach(instance::addChild);
return instance;
}