emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ce6773a 2/2: Minor simplification of module_free_gl


From: Philipp Stephani
Subject: [Emacs-diffs] master ce6773a 2/2: Minor simplification of module_free_global_ref
Date: Sun, 9 Jul 2017 18:34:10 -0400 (EDT)

branch: master
commit ce6773aad5c71f6c486244a6fc9fcb69fc99784d
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Minor simplification of module_free_global_ref
    
    * src/emacs-module.c (module_free_global_ref): Remove unused variable
    'hashcode'.  Inline variable 'value' that's only used once.
---
 src/emacs-module.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index 7e0ba3c..ad6c8fb 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -315,18 +315,13 @@ module_free_global_ref (emacs_env *env, emacs_value ref)
   MODULE_FUNCTION_BEGIN ();
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
   Lisp_Object obj = value_to_lisp (ref);
-  EMACS_UINT hashcode;
-  ptrdiff_t i = hash_lookup (h, obj, &hashcode);
+  ptrdiff_t i = hash_lookup (h, obj, NULL);
 
   if (i >= 0)
     {
-      Lisp_Object value = HASH_VALUE (h, i);
-      EMACS_INT refcount = XFASTINT (value) - 1;
+      EMACS_INT refcount = XFASTINT (HASH_VALUE (h, i)) - 1;
       if (refcount > 0)
-        {
-          value = make_natnum (refcount);
-          set_hash_value_slot (h, i, value);
-        }
+        set_hash_value_slot (h, i, make_natnum (refcount));
       else
         {
           eassert (refcount == 0);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]