]> git.kianting.info Git - clo/blobdiff - src/libclo/breakLines.js
optimize the speed
[clo] / src / libclo / breakLines.js
index f194aa5657eb8cb9edc734418cb0fbe1afc95d13..14a7836178190690f79c86f462067fa58022a4aa 100644 (file)
@@ -88,8 +88,6 @@ class BreakLineAlgorithm {
                 a = tmp;
             }
         }
-        console.log("~~~", lineWidth);
-        console.log(items[itemsLength - 2]);
         return a;
     }
     /**
@@ -119,7 +117,6 @@ class BreakLineAlgorithm {
             this.totalCostAuxStorage[j] = returnCost;
             return returnCost;
         }
-        return returnCost;
     }
     /**
      * check the line cost of a line containing items[i..j]
@@ -129,7 +126,8 @@ class BreakLineAlgorithm {
      * @param lineWidth line width
      */
     lineCost(items, i, j, lineWidth) {
-        if (this.lineCostStorage[i] !== null && this.lineCostStorage[i][j] !== null) {
+        if (this.lineCostStorage[i][j] !== null) {
+            console.log("AA");
             return this.lineCostStorage[i][j];
         }
         if (!this.isBreakPoint(items[j])) {