do not call splice from resetRowCache unnecessarily

This commit is contained in:
nightwing 2013-02-18 14:35:25 +04:00
commit 95257a9be5

View file

@ -223,12 +223,12 @@ var EditSession = function(text, mode) {
this.$screenRowCache = [];
return;
}
var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
var l = this.$docRowCache.length;
this.$docRowCache.splice(i, l);
this.$screenRowCache.splice(i, l);
var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
if (l > i) {
this.$docRowCache.splice(i, l);
this.$screenRowCache.splice(i, l);
}
};
this.$getRowCacheIndex = function(cacheArray, val) {