diff --git a/Remora.Commands/Trees/CommandTreeBuilder.cs b/Remora.Commands/Trees/CommandTreeBuilder.cs index 6c98978..2ec11c3 100644 --- a/Remora.Commands/Trees/CommandTreeBuilder.cs +++ b/Remora.Commands/Trees/CommandTreeBuilder.cs @@ -286,8 +286,8 @@ private IEnumerable ToChildNodes(IEnumerable moduleTypes, IPar // If the group is being hoisted, take the attributes of the parent type(s). ExtractExtraAttributes(parentType, out var extraAttributes, out var extraConditions); - attributes = extraAttributes.Concat(attributes).ToArray(); - conditions = extraConditions.Concat(conditions).ToArray(); + attributes = [..attributes, ..extraAttributes]; + conditions = [..conditions, ..extraConditions]; } var groupNode = new GroupNode(group.ToArray(), groupChildren, parent, group.Key, groupAliases, attributes, conditions, description); @@ -348,16 +348,10 @@ private static void ExtractExtraAttributes(Type parentType, out IEnumerable @@ -395,8 +389,8 @@ private IEnumerable GetModuleCommands(Type moduleType, IParentNode // If the group is being hoisted, take the attributes of the parent type(s). ExtractExtraAttributes(moduleType, out var extraAttributes, out var extraConditions); - attributes = extraAttributes.Concat(attributes).ToArray(); - conditions = extraConditions.Concat(conditions).ToArray(); + attributes = [..attributes, ..extraAttributes]; + conditions = [..conditions, ..extraConditions]; } yield return new CommandNode