mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-11 20:29:24 +00:00
Petite optimisation
This commit is contained in:
@ -17,8 +17,7 @@ void _free__Resident(THIS(Resident)){
|
||||
|
||||
Resident *_init_Resident(int id, char* name, int apartment_floor){
|
||||
Resident * new_resident = malloc_or_die(sizeof(Resident));
|
||||
new_resident->name = malloc_or_die(sizeof(char) * strlen(name));
|
||||
strcpy(new_resident->name, name);
|
||||
new_resident->name = strdup(name);
|
||||
new_resident->id = id;
|
||||
new_resident->apartment_floor = apartment_floor;
|
||||
new_resident->position = new_resident->apartment_floor;
|
||||
|
Reference in New Issue
Block a user