summaryrefslogtreecommitdiffstats
path: root/dimension/tokenize.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-08 23:21:48 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-08 23:21:48 -0600
commit7a21db5914dd7a5666e603d66ed3948b659ba2fc (patch)
treebde8e00a1677ba865adae8a82780d1cc832ece8e /dimension/tokenize.c
parent152362a57dc7fe9dce830ef69118984f854d6375 (diff)
downloaddimension-7a21db5914dd7a5666e603d66ed3948b659ba2fc.tar.xz
New DMNSN_ARRAY_FOREACH() macro, faster than iterating with dmnsn_array_get().
Diffstat (limited to 'dimension/tokenize.c')
-rw-r--r--dimension/tokenize.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c
index efa1064..98253ce 100644
--- a/dimension/tokenize.c
+++ b/dimension/tokenize.c
@@ -67,10 +67,8 @@ dmnsn_delete_token_buffer(void *ptr)
{
dmnsn_token_buffer *tbuffer = ptr;
if (tbuffer) {
- for (size_t i = 0; i < dmnsn_array_size(tbuffer->buffered); ++i) {
- dmnsn_buffered_token buffered;
- dmnsn_array_get(tbuffer->buffered, i, &buffered);
- free(buffered.lval.value);
+ DMNSN_ARRAY_FOREACH (dmnsn_buffered_token *, buffered, tbuffer->buffered) {
+ free(buffered->lval.value);
}
dmnsn_delete_array(tbuffer->buffered);