Skip to content

Commit

Permalink
Count deleted members in hash-tables (fixes euslisp#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
Affonso-Gui committed May 5, 2022
1 parent 38849fc commit 2e4a3d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lisp/l/hashtab.l
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
(when (> count (/ size rehash-size))
(send self :extend)
(setq entry (send self :find sym)) )
(inc count)
(setq entry (- entry size)))
(setq entry (- entry size))
(if (eq (svref key entry) empty)
(inc count)))
(svset key entry sym)
(svset value entry val)
val))
(:delete (sym)
(let ((pos (send self :find sym)) (i 0))
(when (< pos size)
(dec count)
(svset key pos deleted)
(svset value pos nil))) )
(:extend ()
Expand Down

0 comments on commit 2e4a3d8

Please sign in to comment.