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 2cd99fc4141de2fdc6df5784b04eba8fa99127de
Author: Shad Storhaug <[email protected]>
AuthorDate: Sun Sep 13 12:01:19 2020 +0700

    BUG: Lucene.Net.Search.FuzzyTermsEnum: Disabled optimizations for Accept() 
method on .NET Framework because of float comparison failures on x86 in Release 
mode. Fixes TestTokenLengthOpt().
---
 src/Lucene.Net/Search/FuzzyTermsEnum.cs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/Lucene.Net/Search/FuzzyTermsEnum.cs 
b/src/Lucene.Net/Search/FuzzyTermsEnum.cs
index e07dbd5..14039c3 100644
--- a/src/Lucene.Net/Search/FuzzyTermsEnum.cs
+++ b/src/Lucene.Net/Search/FuzzyTermsEnum.cs
@@ -7,6 +7,7 @@ using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Runtime.CompilerServices;
 using JCG = J2N.Collections.Generic;
 
 namespace Lucene.Net.Search
@@ -381,6 +382,9 @@ namespace Lucene.Net.Search
 
             /// <summary>
             /// Finds the smallest Lev(n) DFA that accepts the term. </summary>
+#if NETFRAMEWORK
+            [MethodImpl(MethodImplOptions.NoOptimization)] // LUCENENET 
specific: comparing float equality fails in x86 on .NET Framework with 
optimizations enabled, and is causing the TestTokenLengthOpt test to fail
+#endif
             protected override AcceptStatus Accept(BytesRef term)
             {
                 //System.out.println("AFTE.accept term=" + term);

Reply via email to