From a8ec20de5146479a15d388393b37bbf3e346f619 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Wed, 11 Mar 2020 17:58:41 +0100 Subject: [PATCH] drop refactor --- src/IReferenceCounted.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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); } } -- 2.39.5