Skip to content

Commit

Permalink
docs;
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Feb 3, 2013
1 parent f9b42f3 commit 8292427
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ Model.prototype._version = function _version (where, delta) {
// there is no way to select the correct version. we could fail
// fast here and force them to include the versionKey but
// thats a bit intrusive. can we do this automatically?
// TODO fail fast option?
if (!this.isSelected(key)) {
return;
}
Expand Down Expand Up @@ -1661,7 +1660,6 @@ function populate (model, docs, options, cb) {
return undefined !== item;
});

// no elements or all null/undefined vals
if (0 === ids.length || ids.every(utils.isNullOrUndefined)) {
return cb();
}
Expand Down Expand Up @@ -1721,9 +1719,9 @@ function assign (rawIds, vals, sort, recursed) {
found = false;

if (recursed) {
// find rules
// apply find behavior

// assign matching documents in original order unless sorting (no nulls,undefined)
// assign matching documents in original order unless sorting
for (var f = 0; f < vals.length; ++f) {
if (sid == String(vals[f]._id)) {
found = true;
Expand All @@ -1741,7 +1739,7 @@ function assign (rawIds, vals, sort, recursed) {
}

} else {
// findOne - if document in results, assign, else assign null
// apply findOne behavior - if document in results, assign, else assign null

doc = null;
for (var f = 0; f < vals.length; ++f) {
Expand All @@ -1761,7 +1759,7 @@ function assign (rawIds, vals, sort, recursed) {

// forEach skips over sparse entries in arrays so we
// can safely use this to our advantage dealing with sorted
// result sets
// result sets too.
newOrder.forEach(function (doc, i) {
rawIds[i] = doc;
});
Expand Down

0 comments on commit 8292427

Please sign in to comment.