mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-05 15:03:12 +00:00
makes logreplace command automatically add lowercap versions of from-string
This commit is contained in:
parent
cd17b0c887
commit
16b5ee4fd1
@ -28,14 +28,14 @@ namespace BiblioTech.Rewards
|
||||
|
||||
public void Add(string from, string to)
|
||||
{
|
||||
if (replacements.ContainsKey(from))
|
||||
AddOrUpdate(from, to);
|
||||
|
||||
var lower = from.ToLowerInvariant();
|
||||
if (lower != from)
|
||||
{
|
||||
replacements[from] = to;
|
||||
}
|
||||
else
|
||||
{
|
||||
replacements.Add(from, to);
|
||||
AddOrUpdate(lower, to);
|
||||
}
|
||||
|
||||
Save();
|
||||
}
|
||||
|
||||
@ -55,6 +55,18 @@ namespace BiblioTech.Rewards
|
||||
return result;
|
||||
}
|
||||
|
||||
private void AddOrUpdate(string from, string to)
|
||||
{
|
||||
if (replacements.ContainsKey(from))
|
||||
{
|
||||
replacements[from] = to;
|
||||
}
|
||||
else
|
||||
{
|
||||
replacements.Add(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
ReplaceJson[] replaces = replacements.Select(pair =>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user