From 73cd58b75cd881adf87de1ba31cf29e71897c885 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 27 Dec 2019 01:31:18 -0500 Subject: Space now parses all of this.data --- space.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/space.js b/space.js index 86bd067..4159fc9 100644 --- a/space.js +++ b/space.js @@ -103,12 +103,10 @@ function Space(){ // Iterate over other.data and add to this.data while (this.data.length < offset[0]+other.data.length) this.data.push([]); // Row padding - for (let row = 0; row < other.data.length; row++){ - let thisrow = this.data[row+offset[0]]; - while (thisrow.length < offset[1]+other.data[row].length) thisrow.push(''); // Character-wise padding - for (let chr = 0; chr < other.data[row].length; chr++){ - let thechr = chr+offset[1]; - thisrow[thechr] = func(thisrow[thechr], other.data[row][chr]); + for (let row = 0; row < this.data.length; row++){ + while (this.data[row].length < offset[1]+other.data[row+offset[0]].length) thisrow.push(''); // Character-wise padding + for (let chr = 0; chr < this.data[row].length; chr++){ + thisrow[chr] = func(thisrow[chr], other.data[row+offset[0]][chr+offset[1]] || ''); } } } -- cgit