creating array for each call to getLine is too expensive

if getLines is modified it's better to override getLine too
This commit is contained in:
nightwing 2011-05-21 10:05:45 +05:00 committed by Fabian Jakobs
commit f86b91463e

View file

@ -128,7 +128,7 @@ var Document = function(text) {
* Get a verbatim copy of the given line as it is in the document
*/
this.getLine = function(row) {
return this.getLines(row, row + 1)[0] || "";
return this.$lines[row] || "";
};
this.getLines = function(firstRow, lastRow) {