Skip to content

Commit 4136691

Browse files
Wi1l-B0tNGDAdmin
authored andcommitted
use StringComparison IgnoreCase instead (neo-project#4124)
Co-authored-by: NGD Admin <[email protected]>
1 parent 1fa0e14 commit 4136691

File tree

6 files changed

+120
-66
lines changed

6 files changed

+120
-66
lines changed

src/Neo.CLI/CLI/MainService.Tools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void OnParseCommand(string value)
7575
[ParseFunction(".nef file path to content base64")]
7676
private string? NefFileToBase64(string path)
7777
{
78-
if (Path.GetExtension(path).ToLower() != ".nef") return null;
78+
if (!Path.GetExtension(path).Equals(".nef", StringComparison.CurrentCultureIgnoreCase)) return null;
7979
if (!File.Exists(path)) return null;
8080
return Convert.ToBase64String(File.ReadAllBytes(path));
8181
}

src/Neo.CLI/CLI/MainService.Wallet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void OnCloseWalletCommand()
8686
[ConsoleCommand("upgrade wallet", Category = "Wallet Commands")]
8787
private void OnUpgradeWalletCommand(string path)
8888
{
89-
if (Path.GetExtension(path).ToLowerInvariant() != ".db3")
89+
if (!Path.GetExtension(path).Equals(".db3", StringComparison.InvariantCultureIgnoreCase))
9090
{
9191
ConsoleHelper.Warning("Can't upgrade the wallet file. Check if your wallet is in db3 format.");
9292
return;

src/Neo/Wallets/NEP6/NEP6WalletFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NEP6WalletFactory : IWalletFactory
2020

2121
public bool Handle(string path)
2222
{
23-
return Path.GetExtension(path).ToLowerInvariant() == ".json";
23+
return Path.GetExtension(path).Equals(".json", StringComparison.InvariantCultureIgnoreCase);
2424
}
2525

2626
public Wallet CreateWallet(string name, string path, string password, ProtocolSettings settings)

src/Plugins/SQLiteWallet/SQLiteWalletFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public SQLiteWalletFactory()
2626

2727
public bool Handle(string path)
2828
{
29-
return GetExtension(path).ToLowerInvariant() == ".db3";
29+
return GetExtension(path).Equals(".db3", StringComparison.InvariantCultureIgnoreCase);
3030
}
3131

3232
public Wallet CreateWallet(string name, string path, string password, ProtocolSettings settings)

0 commit comments

Comments
 (0)