lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [2/2] git commit: refs/heads/0.4 - Optimize decoding of similarity values
Date Sun, 19 Oct 2014 18:20:55 GMT
Optimize decoding of similarity values

Decoding of similarity values can be optimized in a similar way.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/853494bc
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/853494bc
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/853494bc

Branch: refs/heads/0.4
Commit: 853494bc5f1760113b41a276a6f72ca57d736802
Parents: 9e574bd
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Oct 19 18:03:50 2014 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Oct 19 20:20:32 2014 +0200

----------------------------------------------------------------------
 core/Lucy/Index/Similarity.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/853494bc/core/Lucy/Index/Similarity.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Similarity.c b/core/Lucy/Index/Similarity.c
index cceffa8..8696a79 100644
--- a/core/Lucy/Index/Similarity.c
+++ b/core/Lucy/Index/Similarity.c
@@ -193,9 +193,7 @@ Sim_Decode_Norm_IMP(Similarity *self, uint32_t input) {
         result = 0;
     }
     else {
-        const uint32_t mantissa = byte & 7;
-        const uint32_t exponent = (byte >> 3) & 31;
-        result = ((exponent + (63 - 15)) << 24) | (mantissa << 21);
+        result = (input + EXP_OFFSET) << 21;
     }
 
     return *(float*)&result;


Mime
View raw message