-
Notifications
You must be signed in to change notification settings - Fork 940
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
move ms to the last place #215
move ms to the last place #215
Conversation
👍 |
2 similar comments
👍 |
👍 |
I wonder what exactly is stopping us from shipping this. cc @TooTallNate |
@steelbrain it may be worth noting that arguments are potentially leaked here, see: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments |
@mbroadst I've seen this used in the node core itself (Although they use |
5b145d5
to
153f491
Compare
not sure it's worth it but I have updated pull request, so now arguments are not leaked didn't know about |
@steelbrain Array.from I believe will make a new copy of the array, and therefore not leak. I'm not really being a stickler here I was just speculating as to why it hasn't been merged yet :) not to mention the performance hit would be negligible considering debug should be a no-op if you haven't enabled debugging for the given category @gorangajic Also I'm pretty sure we can't use Array.from here since its ES6 and this needs to target older versions of node? |
@gorangajic oops, totally wrote that without looking at your code update please ignore the noise! |
var useColors = this.useColors; | ||
var name = this.namespace; | ||
for ( ; i < len; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I don't maintain the project, I would still like to hear why i
is declared above and not here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personal preference I'm sure, hoisting and all that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you inline the i
in the for loop please?
@TooTallNate any updates here? |
this is a great bug fix. I have forked from @TooTallNate who may have abandoned debug from what I can tell. Thank you @gorangajic |
cc @TooTallNate ? |
I am reviewing. Once change is applied I'll gladly merge this |
153f491
to
dafc16e
Compare
@thebigredgeek updated pull request |
@gorangajic merging this. Thanks for the contribution |
when you call debug with more than one param ms diff goes to the second place
before
OK awesome +0ms debug message
after
OK awesome debug message +0ms