Message ID | 1469459025-23606-3-git-send-email-cota@braap.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi On Mon, Jul 25, 2016 at 7:03 PM, Emilio G. Cota <cota@braap.org> wrote: > While at it, remove the unnecessary parentheses around dist->size. > > Signed-off-by: Emilio G. Cota <cota@braap.org> > --- > util/qdist.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/util/qdist.c b/util/qdist.c > index eb2236c..cc31140 100644 > --- a/util/qdist.c > +++ b/util/qdist.c > @@ -62,8 +62,8 @@ void qdist_add(struct qdist *dist, double x, long count) > > if (unlikely(dist->n == dist->size)) { > dist->size *= 2; > - dist->entries = g_realloc(dist->entries, > - sizeof(*dist->entries) * (dist->size)); > + dist->entries = g_realloc_n(dist->entries, dist->size, > + sizeof(*dist->entries)); > } > dist->n++; > entry = &dist->entries[dist->n - 1]; > -- > 2.5.0 > > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
diff --git a/util/qdist.c b/util/qdist.c index eb2236c..cc31140 100644 --- a/util/qdist.c +++ b/util/qdist.c @@ -62,8 +62,8 @@ void qdist_add(struct qdist *dist, double x, long count) if (unlikely(dist->n == dist->size)) { dist->size *= 2; - dist->entries = g_realloc(dist->entries, - sizeof(*dist->entries) * (dist->size)); + dist->entries = g_realloc_n(dist->entries, dist->size, + sizeof(*dist->entries)); } dist->n++; entry = &dist->entries[dist->n - 1];
While at it, remove the unnecessary parentheses around dist->size. Signed-off-by: Emilio G. Cota <cota@braap.org> --- util/qdist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)