Skip to content
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

Potential issue (✔ Fixed) #1

Closed
willemneal opened this issue Mar 17, 2021 · 3 comments
Closed

Potential issue (✔ Fixed) #1

willemneal opened this issue Mar 17, 2021 · 3 comments

Comments

@willemneal
Copy link

Consider this line:

const results: Array<string> = []

It should be:

 const results = new Array<string>();

This change will ensure that a new array is allocated each time the function is called. It used to be the case that an array litteral would allocate one array at compile time and reuse it each time.

@dcodeIO has this been fixed?

@dcodeIO
Copy link

dcodeIO commented Mar 17, 2021

This should have been fixed a while ago, yeah. Unless in a global context where the data can be static, so in functions for example, the data is copied to a new allocation before use.

@willemneal
Copy link
Author

Great!

@JairusSW
Copy link
Owner

@willemneal fixed it. Thanks!
➸ Jairus

@JairusSW JairusSW changed the title Potential issue Potential issue (✔ Fixed) Mar 19, 2021
@JairusSW JairusSW reopened this Mar 29, 2021
Repository owner deleted a comment from BhavyClover Jan 2, 2024
@JairusSW JairusSW closed this as completed Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants