# HG changeset patch # User Steve Losh # Date 1476537150 0 # Node ID 96818717e72de6956a2d2e862fd774273b7ebdf4 # Parent f1e161fed238d219bae416ec97b3db29029c1c30 Don't render `previous-var` in `timing` unless needed diff -r f1e161fed238 -r 96818717e72d losh.lisp --- a/losh.lisp Tue Sep 27 12:13:54 2016 +0000 +++ b/losh.lisp Sat Oct 15 13:12:30 2016 +0000 @@ -762,17 +762,17 @@ (let ((timing-function (ecase time-type ((real-time) #'get-internal-real-time) ((run-time) #'get-internal-run-time))) - (since (or since-var (when (null per-var) - iterate::*result-var*)))) + (since-var (or since-var (when (null per-var) + iterate::*result-var*)))) (with-gensyms (start-time current-time previous-time) `(progn (with ,start-time = (funcall ,timing-function)) (for ,current-time = (funcall ,timing-function)) - (for ,previous-time :previous ,current-time :initially ,start-time) - ,(when since - `(for ,since = (- ,current-time ,start-time))) - ,(when per-var - `(for ,per-var = (- ,current-time ,previous-time))))))) + ,@(when since-var + `((for ,since-var = (- ,current-time ,start-time)))) + ,@(when per-var + `((for ,previous-time :previous ,current-time :initially ,start-time) + (for ,per-var = (- ,current-time ,previous-time)))))))) (defmacro-driver (FOR var IN-LISTS lists) @@ -1364,8 +1364,6 @@ (list key-width key val))))))) - - ;;;; Weightlists (defstruct (weightlist (:constructor %make-weightlist)) weights sums items total)