03.09.2018, 13:16
First of all, thank you for the constructive feedback!
In the first pass, I usually prioritize functional over optimized code - the latter is something I bother about in the second pass, so delegating the progress calculation to a separate function is definitely something I'll do, thanks!
About the stack allocation: So, you're saying that I should just do this?
Quote:
|
Another thing I noticed was a lot of copy-paste code, bar1/bar2 could be globally allocated as `static const` to remove the need to allocate on the stack. And the code that calculates and manipulates the label text could be delegated to a separate function because currently it's copied into three places, if you had to fix a bug you'd have to fix it three times, which increases the chances of typos introducing more bugs!
Aside from that, the code is pretty good. There might be some string manipulation optimisations to be done but it's probably unnecessary. Good work! |
About the stack allocation: So, you're saying that I should just do this?
PHP код:
static const bar1[] = "IIIIIIIIIIIIIIIIIIIIIIIII",
bar2[] = " IIIIIIIIIIIIIIIIIIIIIIIII";


