Skip to content

Commit

Permalink
Avoid unnecessary array allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Nov 24, 2024
1 parent 6c9d4ff commit 462e220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/Undo/CompositeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace NanoByte.Common.Undo;
/// <param name="commands">The commands to be contained inside the transaction.</param>
public class CompositeCommand(params IUndoCommand[] commands) : SimpleCommand
{
private readonly IUndoCommand[] _commands = commands.ToArray(); // Defensive copy
private readonly List<IUndoCommand> _commands = commands.ToList(); // Defensive copy

// Defensive copy

Expand Down

0 comments on commit 462e220

Please sign in to comment.