mirror of
https://github.com/bitwarden/mobile
synced 2025-12-22 03:03:46 +00:00
Removed logs, added null or whitespace validation and improved formatting
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Bit.Core.Services
|
|||||||
ct.ThrowIfCancellationRequested();
|
ct.ThrowIfCancellationRequested();
|
||||||
var matchedCiphers = new List<CipherView>();
|
var matchedCiphers = new List<CipherView>();
|
||||||
var lowPriorityMatchedCiphers = new List<CipherView>();
|
var lowPriorityMatchedCiphers = new List<CipherView>();
|
||||||
query = (query.Trim().ToLower().RemoveDiacritics());
|
query = query.Trim().ToLower().RemoveDiacritics();
|
||||||
|
|
||||||
foreach (var c in ciphers)
|
foreach (var c in ciphers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,8 +6,13 @@ namespace Bit.Core.Utilities
|
|||||||
{
|
{
|
||||||
public static class StringExtensions
|
public static class StringExtensions
|
||||||
{
|
{
|
||||||
public static string RemoveDiacritics(this String text)
|
public static string RemoveDiacritics(this string text)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
var normalizedString = text.Normalize(NormalizationForm.FormD);
|
var normalizedString = text.Normalize(NormalizationForm.FormD);
|
||||||
var stringBuilder = new StringBuilder(capacity: normalizedString.Length);
|
var stringBuilder = new StringBuilder(capacity: normalizedString.Length);
|
||||||
|
|
||||||
@@ -20,14 +25,10 @@ namespace Bit.Core.Utilities
|
|||||||
stringBuilder.Append(c);
|
stringBuilder.Append(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Console.Write(stringBuilder.Length);
|
|
||||||
Console.WriteLine(stringBuilder.ToString().Normalize(NormalizationForm.FormC));
|
|
||||||
|
|
||||||
|
|
||||||
return stringBuilder
|
return stringBuilder
|
||||||
.ToString()
|
.ToString()
|
||||||
.Normalize(NormalizationForm.FormC);
|
.Normalize(NormalizationForm.FormC);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user