code simplification #2
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @bchevalier, I'm Paolo Lupo, this is my personal/hobby account :)
Talking about your PR liabru#533 I had some doubts about the need to define variables like:
positionAX = positionA.x,normalX = normal.xetc.Initially I thought this was part of the "trick", necessary to improve the performance some more, but I didn't like the idea (I'm a Java/C/C++ developer, I'm not that confident with Javascript).
Now... I don't know why you choose to follow that approach, if for a personal coding style or to follow liabru's example like
bodyA = collision.parentA(I think he made this just for readability) or something else.I removed some of those variables, and the performances didn't change (actually the get a little better but I think it's a random thing):
Stress example on chrome:
Complete logs:
simplified.txt
We saved 27 lines of code, but especially the code is more readable (less line of code used just to declare some aliases).
What do you think?