[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/flx b9399afd48 136/182: Simplify math operations in score
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/flx b9399afd48 136/182: Simplify math operations in score calculation |
Date: |
Tue, 13 Dec 2022 03:59:37 -0500 (EST) |
branch: elpa/flx
commit b9399afd487222c04f327d77caf46fbe81cbb080
Author: PythonNut <PythonNut@users.noreply.github.com>
Commit: PythonNut <PythonNut@users.noreply.github.com>
Simplify math operations in score calculation
---
flx.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/flx.el b/flx.el
index 77f3d3477b..b51d5104c1 100644
--- a/flx.el
+++ b/flx.el
@@ -272,14 +272,15 @@ See documentation for logic."
(dolist (index indexes (and match (list match)))
(dolist (elem (flx-get-matches-worker index (1+ q-index)
query-length heatmap
match-cache str-info query))
- (setq score (+ (cadr elem)
- (aref heatmap index)
- (if (= (1- (caar elem)) index)
- (+ (* (min (cddr elem)
- 3)
- 15)
- 60)
- 0)))
+ (setq score (if (= (1- (caar elem)) index)
+ (+ (cadr elem)
+ (aref heatmap index)
+ (* (min (cddr elem)
+ 3)
+ 15)
+ 60)
+ (+ (cadr elem)
+ (aref heatmap index))))
;; we only care about the optimal score
(when (> score best-score)
@@ -308,12 +309,11 @@ See documentation for logic."
query-length heatmap match-cache
str-info query)))
;; postprocess candidate
(and res
- (cons (+ (cl-cadar res)
- (if (and full-match-boost
- (= (length (caar res))
- (length str)))
- 10000
- 0))
+ (cons (if (and full-match-boost
+ (= (length (caar res))
+ (length str)))
+ (+ (cl-cadar res) 10000)
+ (cl-cadar res))
(caar res))))))
(defun flx-propertize (obj score &optional add-score)
- [nongnu] elpa/flx 7452ab1c79 021/182: README update, (continued)
- [nongnu] elpa/flx 7452ab1c79 021/182: README update, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx f566207c82 015/182: travis config update, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 01eef11b96 033/182: small efficiency fix, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 44951ac311 042/182: simplify caching, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx cc3258bb10 038/182: cache key should be based on whole input, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 771f61f3fd 016/182: update test list, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx a792c2c5f1 053/182: change advice to before, fix comments, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 61dcc4f563 089/182: Reset caches on file reload., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 24f5d2cfc5 099/182: Fix typo threshhold -> threshold, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx c45daa261c 124/182: refactor: pull out flx-get-matches-worker function, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx b9399afd48 136/182: Simplify math operations in score calculation,
ELPA Syncer <=
- [nongnu] elpa/flx 8419b1b28f 107/182: Bump version to v0.4 ., ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 46dd7d7edb 144/182: Improve readability, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 807d694555 154/182: remove reference to `flx-ido-big-demo`, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx e05105872f 169/182: Begin sentences with capital letters and end them with a periods, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx dd47185f5b 173/182: flx-inc-vec: Improve doc-string, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 2a816e25df 151/182: Add file misc/.nosearch, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 4cf3f5ad45 059/182: Merge pull request #25 from bbatsov/improve-headers, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 11422574e5 166/182: Merge pull request #106 from jcs-PR/badge, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx 647cb2f92f 168/182: Merge pull request #104 from phst/nocl, ELPA Syncer, 2022/12/13
- [nongnu] elpa/flx ae0981b253 156/182: Merge pull request #87 from spwhitton/apt-get, ELPA Syncer, 2022/12/13