File tree Expand file tree Collapse file tree
src/PetroglyphTools/PG.StarWarsGame.Engine.FileSystem/IO Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,28 +12,20 @@ public sealed partial class PetroglyphFileSystem
1212{
1313 internal void NormalizePath ( ref ValueStringBuilder stringBuilder )
1414 {
15- stringBuilder . Length = NormalizePath ( stringBuilder . RawChars . Slice ( 0 , stringBuilder . Length ) ) ;
15+ NormalizePath ( stringBuilder . RawChars . Slice ( 0 , stringBuilder . Length ) ) ;
1616 }
1717
1818 // TODO: Check whether we can eliminate the double slash normalization
1919 // once we migrated to PGFileSystem
20- private static int NormalizePath ( Span < char > path )
20+ private static void NormalizePath ( Span < char > path )
2121 {
2222 if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
23- return path . Length ;
24-
25- var writePos = 0 ;
26- var lastWasSeparator = false ;
23+ return ;
2724 for ( var i = 0 ; i < path . Length ; i ++ )
2825 {
2926 var c = path [ i ] ;
30- var isSeparator = c is '\\ ' or '/' ;
31- if ( isSeparator && lastWasSeparator )
32- continue ;
33- path [ writePos ++ ] = isSeparator ? '/' : c ;
34- lastWasSeparator = isSeparator ;
27+ if ( IsDirectorySeparator ( c ) )
28+ path [ i ] = '/' ;
3529 }
36-
37- return writePos ;
3830 }
3931}
You can’t perform that action at this time.
0 commit comments