Skip to content

Commit ce48664

Browse files
committed
Use designated initialiser for rbs_buffer_t
1 parent c0c8021 commit ce48664

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/util/rbs_buffer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#include "rbs/util/rbs_assert.h"
33

44
bool rbs_buffer_init(rbs_allocator_t *allocator, rbs_buffer_t *buffer) {
5-
size_t capacity = RBS_BUFFER_DEFAULT_CAPACITY;
5+
*buffer = (rbs_buffer_t) {
6+
.length = 0,
7+
.capacity = RBS_BUFFER_DEFAULT_CAPACITY,
8+
.value = rbs_allocator_calloc(allocator, RBS_BUFFER_DEFAULT_CAPACITY, char),
9+
};
610

7-
buffer->length = 0;
8-
buffer->capacity = capacity;
9-
10-
buffer->value = rbs_allocator_calloc(allocator, capacity, char);
1111
return buffer->value != NULL;
1212
}
1313

0 commit comments

Comments
 (0)