OpenLayers OpenLayers

Ticket #787: removeClearArray.patch

File removeClearArray.patch, 1.6 kB (added by euzuro, 1 year ago)

remove the clear array patch which was only being used in one function of all the code.

  • tests/test_Util.html

    old new  
    3030    } 
    3131 
    3232    function test_03_Util_Array(t) { 
    33         t.plan( 2 ); 
     33        t.plan( 1 ); 
    3434 
    3535        var array = new Array(1,2,3,4,5); 
    3636 
    3737        OpenLayers.Util.removeItem(array, 3); 
    3838        t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");     
    39  
    40         OpenLayers.Util.clearArray(array); 
    41         t.eq( array.toString(), "", "Util.clearArray works");     
    42          
    4339    } 
    4440 
    4541    function test_04_Util_createDiv(t) { 
  • lib/OpenLayers/Util.js

    old new  
    6161    return array; 
    6262}; 
    6363 
    64 /** 
    65 */ 
    66 OpenLayers.Util.clearArray = function(array) { 
    67     array.length = 0; 
    68 }; 
    69  
    7064/** Seems to exist already in FF, but not in MOZ. 
    7165 *  
    7266 * @param {Array} array 
  • lib/OpenLayers/Layer/WFS.js

    old new  
    334334        if (this.tile) { 
    335335            if (this.vectorMode) { 
    336336                this.renderer.clear(); 
    337                 OpenLayers.Util.clearArray(this.features)
     337                this.features.length = 0
    338338            } else {    
    339339                this.clearMarkers(); 
    340                 OpenLayers.Util.clearArray(this.markers)
     340                this.markers.length = 0
    341341            }     
    342342            this.tile.draw(); 
    343343        }