debugout.js icon indicating copy to clipboard operation
debugout.js copied to clipboard

added buffer to concatenate

Open fabiogermann opened this issue 9 years ago • 3 comments

instead of string concatenation (string concatenation will allocate new memory for every change of the string and sometimes cause a memory overflow).

fabiogermann avatar Apr 17 '15 13:04 fabiogermann

Hi, thanks for contributing! I would like to merge, however it looks like you didn't test your code. When you don't pass an argument to join(), it separates with a comma. So you need to change it to an empty string: join(''). But that's not all. It's also ignoring nested objects.

If you can fix these things and thoroughly test before you commit, I can merge.

Thanks, Jamie

inorganik avatar Apr 17 '15 14:04 inorganik

sure. i'll have time this weekend

fabiogermann avatar Apr 17 '15 14:04 fabiogermann

I pushed an updated version. the previous errors have been corrected. However I thought about adding a "newline" in case of nested arrays after the child array was closed. in your original code that would be line 225

fabiogermann avatar Apr 17 '15 19:04 fabiogermann

sorry, let this one sit too long and it got outdated.

inorganik avatar Dec 06 '22 14:12 inorganik