不要怂,就是干,撸起袖子干!

Commit ba3cfab3 by joshm

Doing a deep clone on includes/dao objects can be very slow

1 parent 74f3420d
Showing with 11 additions and 9 deletions
...@@ -354,15 +354,17 @@ module.exports = (function() { ...@@ -354,15 +354,17 @@ module.exports = (function() {
DAOFactory.prototype.findAndCountAll = function(options) { DAOFactory.prototype.findAndCountAll = function(options) {
var self = this var self = this
, opts = Utils._.cloneDeep(options) , copts = Utils._.omit(options, ['offset', 'limit', 'order', 'include', 'attributes'])
, copts = Utils._.extend({}, Utils._.cloneDeep(options) || {}, {
// no limit, offset, order or include for the options given to count() copts = Utils._.extend({}, Utils._.cloneDeep(copts) || {}, {
offset : 0, // no limit, offset, order, attributes or include for the options given to count()
limit : 0, offset : 0,
order : null, limit : 0,
include : null order : null,
}) include : null,
attributes: [],
})
return new Utils.CustomEventEmitter(function (emitter) { return new Utils.CustomEventEmitter(function (emitter) {
var emit = { var emit = {
err : function(e) { // emit error err : function(e) { // emit error
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!