microsoft / microsoft/sqlmanagementobjects
Replace SmoSortedList usage of SortedList with SortedList<ObjectKeyBase, T>
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 143
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
After completing #130, push the type parameters further down into the implementation so we can remove code like this and just return the Values from the list.
// nested enumerator class
// we need that to override the behaviour of SortedList
// that exposes an IDictionaryEnumerator interface
internal sealed class SmoSortedListEnumerator : IEnumerator
{
private IEnumerator baseEnumerator;
internal SmoSortedListEnumerator(IEnumerator enumerator)
{
this.baseEnumerator = enumerator;
}
public object Current
{
get
{
return ((DictionaryEntry)baseEnumerator.Current).Value;
}
}
public bool MoveNext()
{
return baseEnumerator.MoveNext();
}
public void Reset()
{
baseEnumerator.Reset();
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the work in #130 and locating SmoSortedList's use of SortedList. Trace how its enumerator currently exposes values, then verify that the generic implementation can return the list's Values directly without the nested enumerator code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100