mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[Feature] Address Feedback: Use value tuple (int, string) as the sorting key
This commit is contained in:
@@ -86,7 +86,7 @@ namespace System.Management.Automation
|
||||
new ExperimentalFeature(name: "PSFileSystemProviderV2",
|
||||
description: "Replace the old FileSystemProvider with cleaner design and faster code",
|
||||
source: EngineSource,
|
||||
isEnabled: false)),
|
||||
isEnabled: false),
|
||||
*/
|
||||
};
|
||||
EngineExperimentalFeatures = new ReadOnlyCollection<ExperimentalFeature>(engineFeatures);
|
||||
|
||||
+5
-7
@@ -58,15 +58,13 @@ namespace Microsoft.PowerShell.Commands
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Engine features come before module features.
|
||||
/// Within engine features and more features, features are ordered by name.
|
||||
/// Within engine features and module features, features are ordered by name.
|
||||
/// </remarks>
|
||||
private static string GetSortingString(ExperimentalFeature feature)
|
||||
private static (int, string) GetSortingString(ExperimentalFeature feature)
|
||||
{
|
||||
if (ExperimentalFeature.EngineSource.Equals(feature.Source))
|
||||
{
|
||||
return "0:" + feature.Name;
|
||||
}
|
||||
return "1:" + feature.Name;
|
||||
return ExperimentalFeature.EngineSource.Equals(feature.Source, StringComparison.OrdinalIgnoreCase)
|
||||
? (0, feature.Name)
|
||||
: (1, feature.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user