Skip to content

Commit

Permalink
Make MinHeap internal (#695)
Browse files Browse the repository at this point in the history
### Motivation and Context

Fixes #615. Avoid
exposing unnecessary public surface area.

### Description

.NET has a production-grade `PriorityQueue<>`, it's just not available
for netstandard2.0.
  • Loading branch information
stephentoub committed Apr 27, 2023
1 parent 8fc9d7a commit abfbb5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dotnet/src/SemanticKernel/Memory/Collections/MinHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.SemanticKernel.Memory.Collections;
/// Implements the classic 'heap' data structure. By default, the item with the lowest value is at the top of the heap.
/// </summary>
/// <typeparam name="T">Data type.</typeparam>
public class MinHeap<T> : IEnumerable<T> where T : IComparable<T>
internal sealed class MinHeap<T> : IEnumerable<T> where T : IComparable<T>
{
private const int DefaultCapacity = 7;
private const int MinCapacity = 0;
Expand Down Expand Up @@ -219,7 +219,7 @@ private void DownHeap(int startAt)
items[i] = item;
}

public virtual IEnumerator<T> GetEnumerator()
public IEnumerator<T> GetEnumerator()
{
// The 0'th item in the queue is a sentinel. i is 1 based.
for (int i = 1; i <= this._count; ++i)
Expand Down

0 comments on commit abfbb5a

Please sign in to comment.