-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Util.appendToArray
and Util.prependToArray
#9793
Conversation
/botio-linux preview |
/botio test |
While that's certainly correct, it will however result in more allocations[1] since the existing array won't be re-used; please refer to this MDN article:
[1] Whether or not this would be a problem, I don't know. Using |
The former may be replaced by regular JavaScript array concatenation and the latter is unused. This avoids unnecessary function calls/imports.
09df112
to
903bad1
Compare
Good point! With the spread syntax, it's now possible to use the regular |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/c2a283c1d4a601f/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/c2a283c1d4a601f/output.txt Total script time: 3.00 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/da0a4bd7e532796/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.215.176.217:8877/4e61f19347b2287/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/da0a4bd7e532796/output.txt Total script time: 19.13 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/4e61f19347b2287/output.txt Total script time: 23.23 mins
|
That looks great; and it's nice that more (old) code can be removed now! A good follow-up might be to try and replace |
Thank you for checking this! |
Remove `Util.appendToArray` and `Util.prependToArray`
The former may be replaced by regular JavaScript array concatenation and the latter is unused. This avoids unnecessary function calls/imports.