Skip to content

Commit 62bc590

Browse files
Zzullbbatsov
authored andcommitted
Calculate the length of the history only once
1 parent af2bfc2 commit 62bc590

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cider-repl-history.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,16 +636,17 @@ HISTORY-BUF is the history, and optional arg REGEXP is a filter."
636636
#'cider-repl-history-update-highlighted-entry
637637
nil t))
638638
(message
639-
(let ((entry (if (= 1 (length cider-command-history))
640-
"entry"
641-
"entries")))
639+
(let* ((history-length (length cider-command-history))
640+
(entry (if (= 1 history-length)
641+
"entry"
642+
"entries")))
642643
(concat
643644
(if (and (not regexp)
644645
cider-repl-history-display-duplicates)
645646
(format "%s %s in the command history."
646-
(length cider-command-history) entry)
647+
history-length entry)
647648
(format "%s (of %s) %s in the command history shown."
648-
(length items) (length cider-command-history) entry))
649+
(length items) history-length entry))
649650
(substitute-command-keys
650651
(concat " Type \\[cider-repl-history-quit] to quit. "
651652
"\\[describe-mode] for help.")))))

0 commit comments

Comments
 (0)