1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

intmap-remove returns empty-intmap if appropriate

* module/language/cps/intmap.scm (intmap-remove): Return empty-intmap if
  the result is indeed empty.
This commit is contained in:
Andy Wingo 2017-11-21 16:08:00 +01:00
parent a3173d1758
commit bd2c690901

View file

@ -1,5 +1,5 @@
;;; Functional name maps ;;; Functional name maps
;;; Copyright (C) 2014, 2015 Free Software Foundation, Inc. ;;; Copyright (C) 2014, 2015, 2017 Free Software Foundation, Inc.
;;; ;;;
;;; This library is free software: you can redistribute it and/or modify ;;; This library is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU Lesser General Public License as ;;; it under the terms of the GNU Lesser General Public License as
@ -386,7 +386,9 @@ already, and always calls the meet procedure."
(let ((root* (remove (- i min) shift root))) (let ((root* (remove (- i min) shift root)))
(if (eq? root root*) (if (eq? root root*)
map map
(make-intmap/prune min shift root*)))) (if (absent? root*)
empty-intmap
(make-intmap/prune min shift root*)))))
(else map))) (else map)))
(($ <transient-intmap>) (($ <transient-intmap>)
(intmap-remove (persistent-intmap map) i)))) (intmap-remove (persistent-intmap map) i))))