jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [06/13] jena git commit: use singleton binding if no score is requested
Date Tue, 02 Jun 2015 12:56:28 GMT
use singleton binding if no score is requested


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/51cb0351
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/51cb0351
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/51cb0351

Branch: refs/heads/master
Commit: 51cb03511585aea2c5097d6d930acfca5dfc5ee5
Parents: 66eec1b
Author: Osma Suominen <osma.suominen@aalto.fi>
Authored: Tue Jun 2 09:55:27 2015 +0300
Committer: Osma Suominen <osma.suominen@aalto.fi>
Committed: Tue Jun 2 09:55:27 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/jena/query/text/TextHitConverter.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/51cb0351/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java b/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
index 3ee29c9..36ee88b 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextHitConverter.java
@@ -40,11 +40,11 @@ public class TextHitConverter implements Function<TextHit, Binding>
     }
     
     public Binding apply(TextHit hit) {
+        if (score == null)
+            return BindingFactory.binding(binding, match, hit.getNode());
         BindingMap bmap = BindingFactory.create(binding);
         bmap.add(match, hit.getNode());
-        if (score != null) {
-            bmap.add(score, NodeFactoryExtra.floatToNode(hit.getScore()));
-        }
+        bmap.add(score, NodeFactoryExtra.floatToNode(hit.getScore()));
         return bmap;
     }
 }


Mime
View raw message