summaryrefslogtreecommitdiff
path: root/huffman-encode.lisp
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2022-07-14 00:18:08 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2022-07-14 00:18:08 +0900
commit07b08db0c5acdfcfab76f9d812a4ff36d98f0261 (patch)
treef1373f7e6502c1552f5b7df0b1befe8cae56fc56 /huffman-encode.lisp
parent03bd0127e05da64cf0e5b2322095b487a447c93d (diff)
huffman-encode: node-count: Add guards.
Diffstat (limited to 'huffman-encode.lisp')
-rw-r--r--huffman-encode.lisp1
1 files changed, 1 insertions, 0 deletions
diff --git a/huffman-encode.lisp b/huffman-encode.lisp
index eeaa38f..17c9c72 100644
--- a/huffman-encode.lisp
+++ b/huffman-encode.lisp
@@ -103,6 +103,7 @@
:rule-classes :elim)
(defun node-count (x)
+ (declare (xargs :guard (huffman-treep x)))
(if (nodep x)
(+ 1
(node-count (left x))