mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +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();
|
||||
var matchedCiphers = new List<CipherView>();
|
||||
var lowPriorityMatchedCiphers = new List<CipherView>();
|
||||
query = (query.Trim().ToLower().RemoveDiacritics());
|
||||
query = query.Trim().ToLower().RemoveDiacritics();
|
||||
|
||||
foreach (var c in ciphers)
|
||||
{
|
||||
|
||||
@@ -6,8 +6,13 @@ namespace Bit.Core.Utilities
|
||||
{
|
||||
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 stringBuilder = new StringBuilder(capacity: normalizedString.Length);
|
||||
|
||||
@@ -20,14 +25,10 @@ namespace Bit.Core.Utilities
|
||||
stringBuilder.Append(c);
|
||||
}
|
||||
}
|
||||
Console.Write(stringBuilder.Length);
|
||||
Console.WriteLine(stringBuilder.ToString().Normalize(NormalizationForm.FormC));
|
||||
|
||||
|
||||
return stringBuilder
|
||||
.ToString()
|
||||
.Normalize(NormalizationForm.FormC);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user