From 02c4fffa40911fadcce3534c116be3e117d2b858 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 6 Jul 2004 10:52:51 +0000 Subject: [PATCH] No need to test for NULL when reallocating. --- lib/gbuf.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/gbuf.h b/lib/gbuf.h index c2853ba1..59cc36a6 100644 --- a/lib/gbuf.h +++ b/lib/gbuf.h @@ -40,10 +40,7 @@ static inline void GBUF_PREFIX(realloc)(BUF_T *b, uns len) { b->len = len; - if (b->ptr) - b->ptr = xrealloc(b->ptr, len * sizeof(GBUF_TYPE)); - else - b->ptr = xmalloc(len * sizeof(GBUF_TYPE)); + b->ptr = xrealloc(b->ptr, len * sizeof(GBUF_TYPE)); } static inline void -- 2.39.2