Selaa lähdekoodia

change the policy of resizing the buffer when highlighting

Signed-off-by: Le Tan <[email protected]>
Le Tan 9 vuotta sitten
vanhempi
sitoutus
7d77002c53
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      hgmarkdownhighlighter.cpp

+ 2 - 2
hgmarkdownhighlighter.cpp

@@ -206,9 +206,9 @@ void HGMarkdownHighlighter::parseInternal()
     if (len == 0) {
         return;
     } else if (len >= capacity) {
-        resizeBuffer(qMax(2 * capacity, len + 1));
+        resizeBuffer(qMax(2 * capacity, len * 2));
     } else if (len < (capacity >> 2)) {
-        resizeBuffer(qMax(capacity >> 1, len + 1));
+        resizeBuffer(qMax(capacity >> 1, len * 2));
     }
 
     memcpy(content, data, len);