Skip to content

Use DefaultPathSeparator char instead of DefaultPathSeparatorString - #8082

Merged
Ilya (iSazonov) merged 5 commits into
PowerShell:masterfrom
iSazonov:cleanup-defaultpathseparator
Oct 31, 2018
Merged

Ilya (iSazonov) merged 5 commits into
PowerShell:masterfrom
iSazonov:cleanup-defaultpathseparator

Conversation

@iSazonov

@iSazonov Ilya (iSazonov) commented Oct 19, 2018 •

Copy link
Copy Markdown
Collaborator

PR Summary

Replace string operations on char ones by using overloads like StartsWith(char) and EndsWith(char).

It speeds up path operations in filesystem provider and globbing.

PR Checklist

@anmenaga

Copy link
Copy Markdown

I'm curious, what was the reason why Path Separator was a string (rather than a char)?

@SteveL-MSFT

Copy link
Copy Markdown
Member

Andrew (@anmenaga) .NET Framework only has overload for string, .NET Core added overload for char

@iSazonov
Ilya (iSazonov) merged commit ecb467c into PowerShell:master Oct 31, 2018
@iSazonov
Ilya (iSazonov) deleted the cleanup-defaultpathseparator branch October 31, 2018 03:26
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…owerShell#8082)

In:
* SessionStateLocationAPIs
* FileSystemProvider
* LocationGlobber
* NavigationProviderBase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue-Code Cleanup the issue is for cleaning up the code with no impact on functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants