提交 64b20a99 编写于 作者: C Cyrus Najmabadi

Use a consistent comparison method for BKTrees and EditDistance.

上级 65e034a8
......@@ -7,6 +7,7 @@
using System.Threading;
using System.Threading.Tasks;
using Roslyn.Utilities;
using static Roslyn.Utilities.PortableShim;
namespace Microsoft.CodeAnalysis.FindSymbols
{
......@@ -236,7 +237,6 @@ internal static SymbolTreeInfo Create(VersionStamp version, IAssemblySymbol asse
GenerateNodes(assembly.GlobalNamespace, list);
var spellChecker = new SpellChecker(list.Select(n => n.Name));
return new SymbolTreeInfo(version, SortNodes(list), spellChecker);
}
......
......@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.FindSymbols
internal partial class SymbolTreeInfo : IObjectWritable
{
private const string PrefixMetadataSymbolTreeInfo = "<MetadataSymbolTreeInfoPersistence>_";
private const string SerializationFormat = "8";
private const string SerializationFormat = "9";
/// <summary>
/// this is for a metadata reference in a solution
......
......@@ -105,7 +105,7 @@ public Builder(IEnumerable<string> values)
foreach (var ch in value)
{
_concatenatedLowerCaseWords[characterIndex] = char.ToLower(ch);
_concatenatedLowerCaseWords[characterIndex] = CaseInsensitiveComparison.ToLower(ch);
characterIndex++;
}
}
......
......@@ -4,6 +4,7 @@
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis;
using Roslyn.Utilities;
using static System.Math;
......@@ -82,7 +83,7 @@ public IList<string> Find(string value, int? threshold = null)
{
for (var i = 0; i < value.Length; i++)
{
lowerCaseCharacters[i] = char.ToLower(value[i]);
lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
}
threshold = threshold ?? WordSimilarityChecker.GetThreshold(value);
......
......@@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Microsoft.CodeAnalysis;
using static System.Math;
namespace Roslyn.Utilities
......@@ -61,7 +62,7 @@ private static char[] ConvertToLowercaseArray(string text)
var array = ArrayPool<char>.GetArray(text.Length);
for (int i = 0; i < text.Length; i++)
{
array[i] = char.ToLower(text[i]);
array[i] = CaseInsensitiveComparison.ToLower(text[i]);
}
return array;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册