From 462e220a2d2f44fc9e7948f67cddd9eb5ae63a2d Mon Sep 17 00:00:00 2001 From: Bastian Eicher Date: Sun, 24 Nov 2024 18:39:49 +0100 Subject: [PATCH] Avoid unnecessary array allocations --- src/Common/Undo/CompositeCommand.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/Undo/CompositeCommand.cs b/src/Common/Undo/CompositeCommand.cs index 025cce19..ac613759 100644 --- a/src/Common/Undo/CompositeCommand.cs +++ b/src/Common/Undo/CompositeCommand.cs @@ -9,7 +9,7 @@ namespace NanoByte.Common.Undo; /// The commands to be contained inside the transaction. public class CompositeCommand(params IUndoCommand[] commands) : SimpleCommand { - private readonly IUndoCommand[] _commands = commands.ToArray(); // Defensive copy + private readonly List _commands = commands.ToList(); // Defensive copy // Defensive copy