no if statement required before delete[]

This commit is contained in:
Axel Kohlmeyer
2022-04-10 19:55:24 -04:00
parent 3eec2eec9a
commit 74f2b67b1a
20 changed files with 46 additions and 46 deletions

View File

@ -226,7 +226,7 @@ int main(int narg, char **arg)
// extend buffer to fit chunk size
if (n > maxbuf) {
if (buf) delete[] buf;
delete[] buf;
buf = new double[n];
maxbuf = n;
}
@ -260,6 +260,6 @@ int main(int narg, char **arg)
unit_style = nullptr;
}
if (buf) delete[] buf;
delete[] buf;
return 0;
}