From 82ea09e146fc686ba11860902d7760a70201618d Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 21 May 2014 18:22:11 +0800 Subject: [PATCH] when we free it, we know it's not NULL --- src/token.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/token.c b/src/token.c index f5f73eb..5c00e2e 100644 --- a/src/token.c +++ b/src/token.c @@ -21,15 +21,13 @@ str_array * str_array_create(int cap) { } void str_array_free(str_array *l) { - if (l) { - for ( int i = 0; i < l->len ; i++ ) { - char * t = l->tokens[ i ]; - if (t) { - zfree(t); - } + for ( int i = 0; i < l->len ; i++ ) { + char * t = l->tokens[ i ]; + if (t) { + zfree(t); } - zfree(l); } + zfree(l); } bool str_array_is_full(str_array * l) {