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
The following commit(s) were added to refs/heads/master by this push:
new 1458fe2 BUG: Lucene.Net.Search.TermScorer: Added cast to fix
calculation in .NET Framework x86 with optimizations enabled (fixes #549 /
Lucene.Net.Search.TestJoinUtil::TestMultiValueRandomJoin())
1458fe2 is described below
commit 1458fe296f6339b812f738d06b7c07dddca2afec
Author: Shad Storhaug <[email protected]>
AuthorDate: Tue Dec 7 12:46:04 2021 +0700
BUG: Lucene.Net.Search.TermScorer: Added cast to fix calculation in .NET
Framework x86 with optimizations enabled (fixes #549 /
Lucene.Net.Search.TestJoinUtil::TestMultiValueRandomJoin())
---
src/Lucene.Net.Tests.Join/Support/TestJoinUtil.cs | 3 ---
src/Lucene.Net.Tests.Join/TestJoinUtil.cs | 3 ---
src/Lucene.Net/Search/TermScorer.cs | 6 ++++--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/Lucene.Net.Tests.Join/Support/TestJoinUtil.cs
b/src/Lucene.Net.Tests.Join/Support/TestJoinUtil.cs
index f4526fe..dea1ecf 100644
--- a/src/Lucene.Net.Tests.Join/Support/TestJoinUtil.cs
+++ b/src/Lucene.Net.Tests.Join/Support/TestJoinUtil.cs
@@ -393,9 +393,6 @@ namespace Lucene.Net.Tests.Join
[Test]
// [Slow] // LUCENENET specific - Not slow in .NET
-#if NETFRAMEWORK
- [AwaitsFix(BugUrl = "https://github.com/apache/lucenenet/issues/549")]
// LUCENENET TODO: This test fails on x86 .NET Framework in Release mode only
-#endif
public void TestMultiValueRandomJoin()
// this test really takes more time, that is why the number of
iterations are smaller.
{
diff --git a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
index 50d60f2..104bcb5 100644
--- a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
+++ b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
@@ -390,9 +390,6 @@ namespace Lucene.Net.Search.Join
[Test]
// [Slow] // LUCENENET specific - Not slow in .NET
-#if NETFRAMEWORK
- [AwaitsFix(BugUrl = "https://github.com/apache/lucenenet/issues/549")]
// LUCENENET TODO: This test fails on x86 .NET Framework in Release mode only
-#endif
public void TestMultiValueRandomJoin()
// this test really takes more time, that is why the number of
iterations are smaller.
{
diff --git a/src/Lucene.Net/Search/TermScorer.cs
b/src/Lucene.Net/Search/TermScorer.cs
index c791bc0..a227e3d 100644
--- a/src/Lucene.Net/Search/TermScorer.cs
+++ b/src/Lucene.Net/Search/TermScorer.cs
@@ -1,4 +1,4 @@
-using Lucene.Net.Diagnostics;
+using Lucene.Net.Diagnostics;
namespace Lucene.Net.Search
{
@@ -63,7 +63,9 @@ namespace Lucene.Net.Search
public override float GetScore()
{
if (Debugging.AssertsEnabled) Debugging.Assert(DocID !=
NO_MORE_DOCS);
- return docScorer.Score(docsEnum.DocID, docsEnum.Freq);
+
+ // LUCENENET specific: The explicit cast to float is required here
to prevent us from losing precision on x86 .NET Framework with optimizations
enabled
+ return (float)docScorer.Score(docsEnum.DocID, docsEnum.Freq);
}
/// <summary>