GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Code performance fixes follow-up (#14207) · PowerShell/PowerShell@fcafb7f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/System.Management.Automation
    • engine
      • Modules
        • ModuleCmdletBase.cs
      • Subsystem
        • SubsystemManager.cs
      • parser
        • AstVisitor.cs
    • utils
      • EncodingUtils.cs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs‎

Copy file name to clipboardExpand all lines: src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ internal bool LoadUsingModulePath(PSModuleInfo parentModule, bool found, IEnumer
334334
foreach (string folder in Directory.EnumerateDirectories(path))
335335
{
336336
string moduleName = Path.GetFileName(folder);
337-
if (string.Compare(moduleName, fileBaseName, StringComparison.OrdinalIgnoreCase) == 0)
337+
if (string.Equals(moduleName, fileBaseName, StringComparison.OrdinalIgnoreCase))
338338
{
339339
fileBaseName = moduleName;
340340
#endif
@@ -3531,7 +3531,7 @@ private static void PropagateExportedTypesFromNestedModulesToRootModuleScope(Imp
35313531
if (nestedModule != null)
35323532
{
35333533
var exportedTypes = nestedModule.GetExportedTypeDefinitions();
3534-
if (exportedTypes != null && exportedTypes.Count != 0)
3534+
if (exportedTypes != null && exportedTypes.Count > 0)
35353535
{
35363536
foreach (var t in exportedTypes)
35373537
{
Collapse file

‎src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs‎

Copy file name to clipboardExpand all lines: src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private static void RegisterSubsystem(SubsystemInfo subsystemInfo, ISubsystem pr
217217
nameof(proxy));
218218
}
219219

220-
if (subsystemInfo.RequiredCmdlets.Any() || subsystemInfo.RequiredFunctions.Any())
220+
if (subsystemInfo.RequiredCmdlets.Count > 0 || subsystemInfo.RequiredFunctions.Count > 0)
221221
{
222222
// Process 'proxy.CmdletImplementationAssembly' and 'proxy.FunctionsToDefine'
223223
// Functions are added to global scope.
@@ -265,7 +265,7 @@ public static void UnregisterSubsystem(SubsystemKind kind, Guid id)
265265

266266
private static void UnregisterSubsystem(SubsystemInfo subsystemInfo, Guid id)
267267
{
268-
if (subsystemInfo.RequiredCmdlets.Any() || subsystemInfo.RequiredFunctions.Any())
268+
if (subsystemInfo.RequiredCmdlets.Count > 0 || subsystemInfo.RequiredFunctions.Count > 0)
269269
{
270270
throw new NotSupportedException("NotSupported yet: unregister subsystem that introduced new cmdlets/functions.");
271271
}
Collapse file

‎src/System.Management.Automation/engine/parser/AstVisitor.cs‎

Copy file name to clipboardExpand all lines: src/System.Management.Automation/engine/parser/AstVisitor.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ internal static bool Contains(Ast ast, Func<Ast, bool> predicate, bool searchNes
425425

426426
var searcher = new AstSearcher(predicate, stopOnFirst: true, searchNestedScriptBlocks: searchNestedScriptBlocks);
427427
ast.InternalVisit(searcher);
428-
return searcher.Results.Any();
428+
return searcher.Results.Count > 0;
429429
}
430430

431431
internal static bool IsUsingDollarInput(Ast ast)
Collapse file

‎src/System.Management.Automation/utils/EncodingUtils.cs‎

Copy file name to clipboardExpand all lines: src/System.Management.Automation/utils/EncodingUtils.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ internal static Encoding Convert(Cmdlet cmdlet, string encoding)
6464
if (encodingMap.TryGetValue(encoding, out foundEncoding))
6565
{
6666
// Write a warning if using utf7 as it is obsolete in .NET5
67-
if (string.Compare(encoding, Utf7, StringComparison.OrdinalIgnoreCase) == 0)
67+
if (string.Equals(encoding, Utf7, StringComparison.OrdinalIgnoreCase))
6868
{
6969
cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
7070
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.