StoreImpl.cs 756 B

1234567891011121314151617181920212223242526272829
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections
  6. {
  7. internal sealed class StoreImpl<T>
  8. : IStore<T>
  9. {
  10. private readonly List<T> m_contents;
  11. internal StoreImpl(IEnumerable<T> e)
  12. {
  13. m_contents = new List<T>(e);
  14. }
  15. IEnumerable<T> IStore<T>.EnumerateMatches(ISelector<T> selector)
  16. {
  17. foreach (T candidate in m_contents)
  18. {
  19. if (selector == null || selector.Match(candidate))
  20. yield return candidate;
  21. }
  22. }
  23. }
  24. }
  25. #pragma warning restore
  26. #endif