diff --git a/src/Silverback.Integration/Messaging/Sequences/SequenceBase`1.cs b/src/Silverback.Integration/Messaging/Sequences/SequenceBase`1.cs index ff531d282..1483b93d4 100644 --- a/src/Silverback.Integration/Messaging/Sequences/SequenceBase`1.cs +++ b/src/Silverback.Integration/Messaging/Sequences/SequenceBase`1.cs @@ -230,17 +230,15 @@ public Task AbortAsync(SequenceAbortReason reason, Exception? exception = null) /// public IReadOnlyList GetBrokerMessageIdentifiers() { - IReadOnlyList identifiers = _messageIdentifiers?.AsReadOnlyList() ?? - Array.Empty(); + var identifiers = _messageIdentifiers ?? Enumerable.Empty(); if (_sequences != null) { identifiers = identifiers - .Union(_sequences.SelectMany(sequence => sequence.GetBrokerMessageIdentifiers())) - .AsReadOnlyList(); + .Union(_sequences.SelectMany(sequence => sequence.GetBrokerMessageIdentifiers())); } - return identifiers; + return identifiers.AsReadOnlyList(); } ///