Clean-up: improve readability of dynamic buffer append condition
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 10:19:30 +0000 (06:19 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 May 2017 16:39:26 +0000 (12:39 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/dynamic-buffer.c

index ea26a51aca78297cea5b1a7b97840cdec97cf884..f34ae8c492d6bba76818c7e47c004c6f72894bff 100644 (file)
@@ -55,7 +55,7 @@ int lttng_dynamic_buffer_append(struct lttng_dynamic_buffer *buffer,
                goto end;
        }
 
-       if ((buffer->capacity - buffer->size) < len) {
+       if (buffer->capacity < (len + buffer->size)) {
                ret = lttng_dynamic_buffer_set_capacity(buffer,
                                buffer->capacity +
                                (len - (buffer->capacity - buffer->size)));
This page took 0.02802 seconds and 4 git commands to generate.