Skip to content

Commit a02ebb9

Browse files
committed
PR Feedback
Switched to native tuple syntax Co-authored-by: Pranav Senthilnathan <[email protected]>
1 parent 53e5e10 commit a02ebb9

File tree

1 file changed

+3
-3
lines changed
  • src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value

1 file changed

+3
-3
lines changed

src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ private static EnumFieldInfo[] TopologicalSortEnumFields(EnumFieldInfo[] enumFie
676676
return enumFields;
677677
}
678678

679-
var indices = new Tuple<int, int>[enumFields.Length];
679+
var indices = new (int negativePopCount, int index)[enumFields.Length];
680680
for (int i = 0; i < enumFields.Length; i++)
681681
{
682682
// we want values with more bits set to come first so negate the pop count
683-
indices[i] = Tuple.Create(-PopCount(enumFields[i].Key), i);
683+
indices[i] = (-PopCount(enumFields[i].Key), i);
684684
}
685685

686686
Array.Sort(indices);
@@ -689,7 +689,7 @@ private static EnumFieldInfo[] TopologicalSortEnumFields(EnumFieldInfo[] enumFie
689689
for (int i = 0; i < indices.Length; i++)
690690
{
691691
// extract the index from the sorted tuple
692-
int index = indices[i].Item2;
692+
int index = indices[i].index;
693693
sortedFields[i] = enumFields[index];
694694
}
695695

0 commit comments

Comments
 (0)