diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-29 14:15:10 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-29 14:15:10 +0700 |
commit | 435210f10fd927653ce8fbc04ec537ae5d8966b6 (patch) | |
tree | 27b6ed1c029db271c3429ac57629d7f0156c5fed /crypto/src/util/collections/EnumerableProxy.cs | |
parent | Refactoring around Platform (diff) | |
download | BouncyCastle.NET-ed25519-435210f10fd927653ce8fbc04ec537ae5d8966b6.tar.xz |
Generics migration complete
Diffstat (limited to 'crypto/src/util/collections/EnumerableProxy.cs')
-rw-r--r-- | crypto/src/util/collections/EnumerableProxy.cs | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/crypto/src/util/collections/EnumerableProxy.cs b/crypto/src/util/collections/EnumerableProxy.cs index 36f78d342..1d97b8f22 100644 --- a/crypto/src/util/collections/EnumerableProxy.cs +++ b/crypto/src/util/collections/EnumerableProxy.cs @@ -1,50 +1,29 @@ using System; -using System.Collections; using System.Collections.Generic; namespace Org.BouncyCastle.Utilities.Collections { - public sealed class EnumerableProxy - : IEnumerable - { - private readonly IEnumerable inner; - - public EnumerableProxy( - IEnumerable inner) - { - if (inner == null) - throw new ArgumentNullException("inner"); - - this.inner = inner; - } - - public IEnumerator GetEnumerator() - { - return inner.GetEnumerator(); - } - } - internal sealed class EnumerableProxy<T> : IEnumerable<T> { - private readonly IEnumerable<T> m_inner; + private readonly IEnumerable<T> m_target; - internal EnumerableProxy(IEnumerable<T> inner) + internal EnumerableProxy(IEnumerable<T> target) { - if (inner == null) - throw new ArgumentNullException("inner"); + if (target == null) + throw new ArgumentNullException(nameof(target)); - m_inner = inner; + m_target = target; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { - return m_inner.GetEnumerator(); + return m_target.GetEnumerator(); } public IEnumerator<T> GetEnumerator() { - return m_inner.GetEnumerator(); + return m_target.GetEnumerator(); } } } |