Skip to content

Commit

Permalink
no need to slice the arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Apr 27, 2011
1 parent 17641b7 commit 1a67d10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/mongoose/query.js
Expand Up @@ -528,11 +528,12 @@ Query.prototype._applyFields = function (fields) {
*/

Query.prototype.sort = function () {
var sort = this.options.sort || (this.options.sort = [])
, args = [].slice.call(arguments);
inGroupsOf(2, args, function (field, value) {
var sort = this.options.sort || (this.options.sort = []);

inGroupsOf(2, arguments, function (field, value) {
sort.push([field, value]);
});

return this;
};

Expand Down

0 comments on commit 1a67d10

Please sign in to comment.