Lists.cs 518 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Text;
  5. namespace Google.ProtocolBuffers.Collections {
  6. /// <summary>
  7. /// Utilities class for dealing with lists.
  8. /// </summary>
  9. static class Lists<T> {
  10. static readonly ReadOnlyCollection<T> empty = new ReadOnlyCollection<T>(new T[0]);
  11. /// <summary>
  12. /// Returns an immutable empty list.
  13. /// </summary>
  14. internal static ReadOnlyCollection<T> Empty {
  15. get { return empty; }
  16. }
  17. }
  18. }