Skip to content

Consider removing DirectiveCollection #1912

Closed

Description

@jonsequitur

It can likely be replaced with a dictionary, or directives can become symbols and use the same lookup mechanisms are other symbol types use.

    // From guideline prose:
    // "When implementing such a custom collection, follow the API pattern
    // established by Collection<T> and ReadOnlyCollection<T> as
    // closely as possible. That is, implement the same members explicitly,
    // name the parameters in the same way that these two collections name
    // them, and so on. In other words, make your custom collection different
    // from these two collections only when you have a very good reason to
    // do so."
    public class DirectiveCollection : IEnumerable<KeyValuePair<string,IEnumerable<string>>>, IEnumerable 
    {
        public DirectiveCollection();
        public bool Contains(string name);
        public IEnumerator<KeyValuePair<string,IEnumerable<string>>> GetEnumerator();
        public bool TryGetValues(string name, ref IReadOnlyList<string> values);
    }

Activity

  1. changed the title [-]Consider removing this type. It can likely be replaced with a dictionary, or directives can become symbols.[/-] [+]Consider removing `DirectiveCollection`[/+] on Nov 2, 2022
  2. self-assigned this
    on Nov 3, 2022
  3. added a commit that references this issue on Nov 3, 2022
    09b627a
  4. added this to the 2.0 GA milestone on Nov 9, 2022
  5. added a commit that references this issue on Jan 28, 2024
    466d165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions