From f09b2721080bfce610ed389e560f20f01161c854 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Subject: [PATCH 16/39] move {INC,DEC}-WORD-COUNT to avoid STYLE-WARNINGs --- src/lisp/structs.lisp | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lisp/structs.lisp b/src/lisp/structs.lisp index 7bd1805..2d6b228 100755 --- a/src/lisp/structs.lisp +++ b/src/lisp/structs.lisp @@ -104,6 +104,22 @@ (char-code (aref str level)) 0))) +(defun inc-word-count (tr) + (declare (type trie tr)) + (let ((parent (trie-parent tr))) + (declare (type (or null trie) parent)) + (when parent + (setf (trie-word-count parent) (+ (trie-word-count parent) 1)) + (inc-word-count parent)))) + +(defun dec-word-count(tr) + (declare (type trie tr)) + (let ((parent (trie-parent tr))) + (declare (type (or null trie) parent)) + (when parent + (setf (trie-word-count parent) (- (trie-word-count parent) 1)) + (dec-word-count parent)))) + (defun trie-insert (tr str) "inserts the string into the trie" (declare (type trie tr) @@ -203,22 +219,6 @@ (ttr (aref children ind))) (and (not (eql ttr 0)) (trie-begin-p ttr str)))))) -(defun inc-word-count (tr) - (declare (type trie tr)) - (let ((parent (trie-parent tr))) - (declare (type (or null trie) parent)) - (when parent - (setf (trie-word-count parent) (+ (trie-word-count parent) 1)) - (inc-word-count parent)))) - -(defun dec-word-count(tr) - (declare (type trie tr)) - (let ((parent (trie-parent tr))) - (declare (type (or null trie) parent)) - (when parent - (setf (trie-word-count parent) (- (trie-word-count parent) 1)) - (dec-word-count parent)))) - (defun get-child (tr ch) (declare (type trie tr) (type character ch)) -- 1.6.2