emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vlf 48a014f 250/310: Fix write measuring and endless lo


From: Stefan Monnier
Subject: [elpa] externals/vlf 48a014f 250/310: Fix write measuring and endless loop in nearby approximation.
Date: Sat, 28 Nov 2020 00:33:25 -0500 (EST)

branch: externals/vlf
commit 48a014f3bc1cb6ea3633d135e5064f736fab8207
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Fix write measuring and endless loop in nearby approximation.
---
 vlf-tune.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlf-tune.el b/vlf-tune.el
index b711c5a..d4b39a4 100644
--- a/vlf-tune.el
+++ b/vlf-tune.el
@@ -153,8 +153,8 @@ VEC is a vector of (mean time . count) elements ordered by 
size."
   "Save buffer and save time it takes.
 START, END, APPEND, VISIT have same meaning as in `write-region'.
 SIZE is number of bytes that are saved."
-  (let ((time (car (write-region start end buffer-file-name
-                                 append visit))))
+  (let ((time (car (vlf-time (write-region start end buffer-file-name
+                                           append visit)))))
     (vlf-tune-add-measurement vlf-tune-write-bps size time)))
 
 (defun vlf-tune-hexlify ()
@@ -192,7 +192,9 @@ SIZE is number of bytes that are saved."
                                (1+ right-idx))
                       val (if (zerop val)
                               right
-                            (/ (+ val right) 2)))))))
+                            (/ (+ val right) 2))))))
+      (setq left-idx (1- left-idx)
+            right-idx (1+ right-idx)))
     val))
 
 (defmacro vlf-tune-approximate (vec index)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]