diff options
| author | Philipp Stephani <phst@google.com> | 2017-07-10 00:33:30 +0200 |
|---|---|---|
| committer | Philipp Stephani <phst@google.com> | 2017-07-10 00:33:30 +0200 |
| commit | ce6773aad5c71f6c486244a6fc9fcb69fc99784d (patch) | |
| tree | 3e937910ce3ef7684e6c9f78a530bc5faa174b79 /src/emacs-module.c | |
| parent | 81131ff26fe2a36c2ed0a4853d85af3bcb8bbdb1 (diff) | |
| download | emacs-ce6773aad5c71f6c486244a6fc9fcb69fc99784d.tar.gz | |
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.
Diffstat (limited to 'src/emacs-module.c')
| -rw-r--r-- | src/emacs-module.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index 7e0ba3c16c1..ad6c8fb0104 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); |
