utils: Merge vector_prepend() if statements
@@ -67,11 +67,9 @@ int vector_append(vector *vec, const void *value) {
}
int vector_prepend(vector *vec, const void *value) {
- if(vec->blocks >= vec->reserved) {
- if(vector_grow(vec)) {
+ if(vec->blocks >= vec->reserved && vector_grow(vec)) {
return 1;
}
- }
char *dst = (char*)(vec->data + vec->block_size);
memmove(dst, vec->data, vec->block_size * vec->blocks);
memcpy(dst, value, vec->block_size);
