Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Code review feedback.
  • Loading branch information
mjp41 committed Mar 7, 2017
commit 0e302d89df56545e364988ea869416570a66e693
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,21 @@ internal override T MinInternal
Node current = _root;
T result = default(T);

while (current != null) {
while (current != null)
{

int comp = _lBoundActive ? Comparer.Compare(_min, current.Item) : -1;
if (comp == 1) {
if (comp == 1)
{
current = current.Right;
} else {
}
else
{
result = current.Item;
if (comp == 0)
{
break;
}
current = current.Left;
}
}
Expand All @@ -155,15 +161,20 @@ internal override T MaxInternal
Node current = _root;
T result = default(T);

while (current != null) {

while (current != null)
{
int comp = _uBoundActive ? Comparer.Compare(_max, current.Item) : 1;
if (comp == -1) {
if (comp == -1)
{
current = current.Left;
} else {
}
else
{
result = current.Item;
if (comp == 0)
{
break;
}
current = current.Right;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ public void SortedSet_Generic_GetViewBetween_MinMax_Exhaustive()
{
SortedSet<int> view = set.GetViewBetween(i, j);

if (j < i || (j == i && i % 2 == 0) ){
if (j < i || (j == i && i % 2 == 0) )
{
Assert.Equal(default(int), view.Min);
Assert.Equal(default(int), view.Max);
} else {
}
else
{
Assert.Equal(i + ((i+1) % 2), view.Min);
Assert.Equal(j - ((j+1) % 2), view.Max);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: same style nits, e.g. braces

Expand Down