Skip to content

Commit f1f113d

Browse files
committed
avoid sort -g
scale the score so we can work with ints
1 parent 4f08e7f commit f1f113d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

z.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ _z() {
142142
function frecent(rank, time) {
143143
# relate frequency and time
144144
dx = t - time
145-
return rank * (3.75/((0.0001 * dx + 1) + 0.25))
145+
return int(10000 * rank * (3.75/((0.0001 * dx + 1) + 0.25)))
146146
}
147147
function output(matches, best_match, common) {
148148
# list or return the desired directory
149149
if( list ) {
150-
cmd = "sort -g >&2"
150+
cmd = "sort -n >&2"
151151
for( x in matches ) {
152152
if( matches[x] ) {
153153
printf "%-10s %s\n", matches[x], x | cmd

0 commit comments

Comments
 (0)