Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Oct 6, 2011
1 parent 424aae9 commit 27806f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ Model.prototype._populate = function populate (schema, oid, options, fn) {
if (err) return fn(err);

// put back in original id order (using a hash reduces complexity from n*n to 2n)
var docHash = {}
docs.forEach(function(doc) {
var docHash = {};
docs.forEach(function (doc) {
docHash[doc.id] = doc;
});
oid.forEach(function(id) {
oid.forEach(function (id) {
arr.push(docHash[id] || null);
});
fn(null, arr);
Expand Down
4 changes: 2 additions & 2 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,8 +1070,8 @@ Query.prototype.populate = function (path, fields, conditions) {
// necessary to keep backward compatibility (fields could be
// an array, string, or object literal).
this.options.populate[path] = {
conditions: conditions,
fields: fields
conditions: conditions
, fields: fields
};
return this;
};
Expand Down

0 comments on commit 27806f3

Please sign in to comment.