perf(core): remove some extra instructions

This commit is contained in:
Masahiko AMANO 2022-12-29 21:34:10 +03:00
parent 28ee348dad
commit 90e5761d3e
2 changed files with 0 additions and 3 deletions

View File

@ -131,10 +131,8 @@ int tanzaku_add(Sappyou *sappyou, const char *name, const char *description) {
description_size = strlen(description); description_size = strlen(description);
newbie.name = malloc(name_size + 1); newbie.name = malloc(name_size + 1);
strcpy(newbie.name, name); strcpy(newbie.name, name);
newbie.name[name_size] = 0;
newbie.description = malloc(description_size + 1); newbie.description = malloc(description_size + 1);
strcpy(newbie.description, description); strcpy(newbie.description, description);
newbie.description[description_size] = 0;
if (sappyou->hole_cnt > 0) { if (sappyou->hole_cnt > 0) {
sappyou->hole_cnt--; sappyou->hole_cnt--;
Tanzaku **hole_ptr = sappyou->holes + sappyou->hole_cnt; Tanzaku **hole_ptr = sappyou->holes + sappyou->hole_cnt;

View File

@ -128,7 +128,6 @@ int sasa_add(Sasahyou *sasahyou, const char *path) {
size_t path_size = strlen(path); size_t path_size = strlen(path);
newbie.path = malloc(path_size + 1); newbie.path = malloc(path_size + 1);
strcpy(newbie.path, path); strcpy(newbie.path, path);
newbie.path[path_size] = 0;
if (sasahyou->hole_cnt > 0) { if (sasahyou->hole_cnt > 0) {
sasahyou->hole_cnt--; sasahyou->hole_cnt--;
Sasa **hole_ptr = sasahyou->holes + sasahyou->hole_cnt; Sasa **hole_ptr = sasahyou->holes + sasahyou->hole_cnt;