1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,680
    Vote Rating
    491
    LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future

      0  

    Default Store.each duplicates AbstractMixedCollection.each, why?

    I'm curious why Store.each duplicates AbstractMixedCollection.each code as opposed to directly calling AbstractMixedCollection.each.

    The only difference is that AbstractMixedCollection.each is safe for removal...
    Code:
    Ext.define('Ext.data.Store', {
        ...
        each: function(fn, scope) {
            var data = this.data.items,
                dLen = data.length,
                record, d;
    
    
            for (d = 0; d < dLen; d++) {
                record = data[d];
                if (fn.call(scope || record, record, d, dLen) === false) {
                    break;
                }
            }
        },
        ...    
    
    
    Ext.define('Ext.util.AbstractMixedCollection', {
        ...
        each : function(fn, scope){
            var items = Ext.Array.push([], this.items), // each safe for removal
                i = 0,
                len = items.length,
                item;
    
    
            for (; i < len; i++) {
                item = items[i];
                if (fn.call(scope || item, item, i, len) === false) {
                    break;
                }
            }
        },
        ...

  2. #2
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,680
    Vote Rating
    491
    LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future LesJ has a brilliant future

      0  

    Default

    I added a feature request ticket