-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change PathInternal.IsCaseSensitive to a constant (#54340)
* Return constants in PathInternal.GetIsCaseSensitive() on mobile platforms In particular on Android probing using I/O is slow and contributes to slow app startup. Fixes #54339 * Implement Path.IsCaseSensitive as PathInternal.IsCaseSensitive Also Path.StringComparison => PathInternal.StringComparison * Add test for PathInternal.IsCaseSensitive Move GetIsCaseSensitiveByProbing to FileSystemTest * Drop PathInternal.s_isCaseSensitive cache field * Delete Path.IsCaseSensitive and Path.StringComparison update callers to use PathInternal.IsCaseSensitive and PathInternal.StringComparison * Remove catch clause from GetIsCaseSensitiveByProbing * Mark new test [OuterLoop] * Apply suggestions from code review Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com> Co-authored-by: Stephen Toub <stoub@microsoft.com>
- Loading branch information
1 parent
fa86c81
commit c0ed319
Showing
9 changed files
with
52 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/libraries/System.IO.FileSystem/tests/PathInternalTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Xunit; | ||
|
||
namespace System.IO.Tests | ||
{ | ||
public class PathInternalTests : FileSystemTest | ||
{ | ||
[Fact] | ||
[OuterLoop] | ||
public void PathInternalIsCaseSensitiveMatchesProbing() | ||
{ | ||
string probingDirectory = TestDirectory; | ||
Assert.Equal(GetIsCaseSensitiveByProbing(probingDirectory), PathInternal.IsCaseSensitive); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters