Skip to content

Commit

Permalink
faster for loop when resolving keypath
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 9, 2017
1 parent b3880b6 commit 7b8947e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,9 @@
* @return {Object} resolved object
*/
var resolveKeyPath = function (instance, obj, keypath, val) {
var i = null;
keypath = keypath.replace(hashRE, '.$1');
var path = keypath.split(".");
for (i = 0; i < path.length - 1; i++) {
for (var i = 0; i < path.length - 1; i++) {
var propName = path[i];
obj = obj[propName];
}
Expand Down
Loading

0 comments on commit 7b8947e

Please sign in to comment.