From: Javier Sancho Date: Wed, 11 Mar 2020 16:58:41 +0000 (+0100) Subject: drop refactor X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=a8ec20de5146479a15d388393b37bbf3e346f619;p=guile-irrlicht.git drop refactor --- diff --git a/src/IReferenceCounted.cpp b/src/IReferenceCounted.cpp index b787821..0038d18 100644 --- a/src/IReferenceCounted.cpp +++ b/src/IReferenceCounted.cpp @@ -36,16 +36,12 @@ extern "C" { SCM irr_drop (SCM wrapped_obj) { + bool result = 0; if (device_p (wrapped_obj)) { - irr::IrrlichtDevice* obj = unwrap_device (wrapped_obj); - return scm_from_bool (obj->drop ()); - } - else - { - irr::IReferenceCounted* obj = (irr::IReferenceCounted*)scm_foreign_object_ref (wrapped_obj, 0); - return scm_from_bool (obj->drop ()); + result = unwrap_device (wrapped_obj)->drop (); } + return scm_from_bool (result); } }