From 7937ba477539072253c46cea28b3d16b9d6c755f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 25 Apr 2019 19:10:35 +0200 Subject: Move single curly brace. This fixes an error where the property list of an object would be rebuilt every time it was accessed. This was both slow and wrong. --- src/guile_interface.scm.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/guile_interface.scm.c b/src/guile_interface.scm.c index 0f795d44..63d3f737 100644 --- a/src/guile_interface.scm.c +++ b/src/guile_interface.scm.c @@ -68,22 +68,23 @@ SCM_DEFINE (vcomponent_get_attribute, "%vcomponent-get-attribute", 2, 0, 0, val = scm_cons(val, SCM_MAKE_HASH_TABLE()); v->key.scm = val; scm_gc_protect_object(v->key.scm); - } - triekeys = KEYS(TRIE(param_set))(&v->val); - /* For every property key bound to the current attribute */ - FOR (LLIST, strbuf, k, triekeys) { - proplist = SCM_EOL; + triekeys = KEYS(TRIE(param_set))(&v->val); + /* For every property key bound to the current attribute */ + FOR (LLIST, strbuf, k, triekeys) { + proplist = SCM_EOL; - trievals = GET(TRIE(param_set))(&v->val, k->mem); - /* For every value bound to the current property */ - FOR (LLIST, strbuf, s, trievals) { - proplist = scm_cons(scm_from_strbuf(s), proplist); - } + trievals = GET(TRIE(param_set))(&v->val, k->mem); + /* For every value bound to the current property */ + FOR (LLIST, strbuf, s, trievals) { + proplist = scm_cons(scm_from_strbuf(s), proplist); + } - scm_hashq_set_x(scm_cdr(val), scm_from_strbuf_symbol(k), - scm_reverse(proplist)); + scm_hashq_set_x(scm_cdr(val), scm_from_strbuf_symbol(k), + scm_reverse(proplist)); + } } + attrlist = scm_cons(val, attrlist); } -- cgit v1.2.3