Browse Source

startup: use `.hasOwnProperty` instead of `in`

Benchmarks show that `.hasOwnProperty` is faster than `in` in V8. It
makes startup ~0.5 ms faster on my computer.
v0.9.1-release
Maciej Małecki 13 years ago
committed by Ben Noordhuis
parent
commit
c3a9733ac1
  1. 2
      src/node.js

2
src/node.js

@ -491,7 +491,7 @@
} }
NativeModule.exists = function(id) { NativeModule.exists = function(id) {
return (id in NativeModule._source); return NativeModule._source.hasOwnProperty(id);
} }
NativeModule.getSource = function(id) { NativeModule.getSource = function(id) {

Loading…
Cancel
Save