-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
use strict #785
use strict #785
Conversation
// var msgpack = { | ||
// encode: MsgPack.pack, | ||
// decode: function(str) { return MsgPack.unpack(new Buffer(str)); } | ||
// }; |
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 explain to someone not so familiar with the codebase why you commented this out? If it's not used at all, it should be deleted.
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.
module.exports = msgpack;
is already commented out and therefor this is a unused variable. I was not sure what this part was for and normally I'd just delete unused code, but I'd prefer to know the reason for the original code before deleting it :).
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.
Thanks! Looks to me like they were considering using MessagePack for this functionality, but as the node library is slower than native JSON encoding and this is for benchmarking only (so compression gains were not useful), the decision was made just to use JSON instead. I think this is safe to be deleted.
I fully support this! I asked one question about some commented code. |
This is going to improve the performance minimal and improves the safety of the code
This is just a style change
util.print has been deprecated in node
Rebased |
👍 |
Add "use strict", semicolons, whitespace & code cleanup, remove util.print.
This is going to improve the speed and code safety a tiny bit by using
use strict
plus some style changes (adding semicolons). I added the later as I read that most of you seemed to prefer those. Using use strict in node should not break any code if it has not been broken before, since node encapsulates each file and does not apply it global.