This is an automated email from the ASF dual-hosted git repository. nightowl888 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/lucenenet.git
commit 2ac13277dd154785442ead5139e825c8a4da1c5d Author: Shad Storhaug <[email protected]> AuthorDate: Sun Sep 13 11:33:58 2020 +0700 BUG: Lucene.Net.Sandbox.Queries.SlowFuzzyTermsEnum: Disabled optimizations on .NET Framework because of float comparison failures on x86 in Release mode. Fixes TestTokenLengthOpt(). --- src/Lucene.Net.Sandbox/Queries/FuzzyLikeThisQuery.cs | 4 ++++ src/Lucene.Net.Sandbox/Queries/SlowFuzzyTermsEnum.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Lucene.Net.Sandbox/Queries/FuzzyLikeThisQuery.cs b/src/Lucene.Net.Sandbox/Queries/FuzzyLikeThisQuery.cs index e8fb2d7..02980b3 100644 --- a/src/Lucene.Net.Sandbox/Queries/FuzzyLikeThisQuery.cs +++ b/src/Lucene.Net.Sandbox/Queries/FuzzyLikeThisQuery.cs @@ -6,6 +6,7 @@ using Lucene.Net.Search.Similarities; using Lucene.Net.Util; using System; using System.Collections.Generic; +using System.Runtime.CompilerServices; using JCG = J2N.Collections.Generic; namespace Lucene.Net.Sandbox.Queries @@ -363,6 +364,9 @@ namespace Lucene.Net.Sandbox.Queries /// (non-Javadoc) /// <see cref="Util.PriorityQueue{T}.LessThan(T, T)"/> /// </summary> +#if NETFRAMEWORK + [MethodImpl(MethodImplOptions.NoOptimization)] // LUCENENET specific: comparing score equality fails in x86 on .NET Framework with optimizations enabled +#endif protected internal override bool LessThan(ScoreTerm termA, ScoreTerm termB) { if (termA.Score == termB.Score) diff --git a/src/Lucene.Net.Sandbox/Queries/SlowFuzzyTermsEnum.cs b/src/Lucene.Net.Sandbox/Queries/SlowFuzzyTermsEnum.cs index b7e8ba3..6acb46f 100644 --- a/src/Lucene.Net.Sandbox/Queries/SlowFuzzyTermsEnum.cs +++ b/src/Lucene.Net.Sandbox/Queries/SlowFuzzyTermsEnum.cs @@ -3,6 +3,7 @@ using Lucene.Net.Search; using Lucene.Net.Util; using System; using System.IO; +using System.Runtime.CompilerServices; namespace Lucene.Net.Sandbox.Queries { @@ -120,6 +121,9 @@ namespace Lucene.Net.Sandbox.Queries /// where distance is the Levenshtein distance for the two words. /// </para> /// </summary> +#if NETFRAMEWORK + [MethodImpl(MethodImplOptions.NoOptimization)] // LUCENENET specific: comparing float equality fails in x86 on .NET Framework with optimizations enabled. Fixes TestTokenLengthOpt. +#endif protected override sealed AcceptStatus Accept(BytesRef term) { if (StringHelper.StartsWith(term, prefixBytesRef))
