Skip to content

Commit

Permalink
Merge pull request #3665 from mridgway/replaceHasOwnProperty
Browse files Browse the repository at this point in the history
[performance] Replace hasOwnProperty in child processing with typeof undefined check
  • Loading branch information
sophiebits committed Apr 22, 2015
2 parents d235940 + ed70d35 commit 3c66b8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/ReactChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function mapSingleChildIntoContext(traverseContext, child, name, i) {
var mapBookKeeping = traverseContext;
var mapResult = mapBookKeeping.mapResult;

var keyUnique = !mapResult.hasOwnProperty(name);
var keyUnique = (mapResult[name] === undefined);
if (__DEV__) {
warning(
keyUnique,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/flattenChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var warning = require('warning');
function flattenSingleChildIntoContext(traverseContext, child, name) {
// We found a component instance.
var result = traverseContext;
var keyUnique = !result.hasOwnProperty(name);
var keyUnique = (result[name] === undefined);
if (__DEV__) {
warning(
keyUnique,
Expand Down

0 comments on commit 3c66b8f

Please sign in to comment.