train
This commit is contained in:
@@ -34,8 +34,6 @@ struct vector *vector_append(struct vector *v, struct animal *animal){
|
||||
if(v == NULL || animal == NULL) return NULL;
|
||||
|
||||
if (v->capacity <= v->size) v = vector_resize(v, v->capacity * 2);
|
||||
// TODO A voir si le realloc ajoute de l'espace a gauche ou a droite
|
||||
// car sinon y a ecrasement de data
|
||||
v->animal[v->size] = animal;
|
||||
v->size ++;
|
||||
return v;
|
||||
@@ -70,5 +68,4 @@ void vector_destroy(struct vector *v){
|
||||
|
||||
free(v->animal);
|
||||
free(v);
|
||||
//free_animal(v->animal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user