diff options
author | Colin Okay <colin@cicadas.surf> | 2022-06-29 06:34:36 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-06-29 06:34:36 -0500 |
commit | 581e6a0c52cc7cb1e6fd5e0d65a83630a00f8551 (patch) | |
tree | 72e7c4d6feab80d080cedca7e8cf5c79dddd8e91 /wheelwork.lisp | |
parent | 30cf40b67c5f2bf8dcbdcbef5c6a7969d20908c6 (diff) |
[refactor] drop-unit to use when-let
Diffstat (limited to 'wheelwork.lisp')
-rw-r--r-- | wheelwork.lisp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wheelwork.lisp b/wheelwork.lisp index 6dd8f64..9d7571d 100644 --- a/wheelwork.lisp +++ b/wheelwork.lisp @@ -63,9 +63,9 @@ (defmethod drop-unit ((unit unit)) "Removes a unit from its container. Returns T if the unit actually was removed." - (when (unit-container unit) + (when-let (container (unit-container unit)) (setf - (container-units (unit-container unit)) (delete unit (container-units (unit-container unit))) + (container-units container) (delete unit (container-units container)) (unit-container unit) nil) t)) |