Browse Source

fcl-js: jswriter: allow overriding Writing, less grows(faster and less allocations)

git-svn-id: trunk@36599 -
Mattias Gaertner 8 years ago
parent
commit
a66eaa4769
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/fcl-js/src/jswriter.pp

+ 3 - 3
packages/fcl-js/src/jswriter.pp

@@ -38,7 +38,7 @@ Type
   protected
     Function DoWrite(Const S : AnsiString) : Integer; virtual; abstract;
     Function DoWrite(Const S : UnicodeString) : Integer; virtual; abstract;
-    Procedure Writing; // called before adding new characters
+    Procedure Writing; virtual; // called before adding new characters
   Public
     // All functions return the number of bytes copied to output stream.
     constructor Create;
@@ -268,7 +268,7 @@ begin
   MinLen:=Result+FBufPos;
   If (MinLen>Capacity) then
     begin
-    DesLen:=(FCapacity*5) div 4;
+    DesLen:=(FCapacity*3) div 2;
     if DesLen>MinLen then
       MinLen:=DesLen;
     Capacity:=MinLen;
@@ -288,7 +288,7 @@ begin
   MinLen:=Result+FBufPos;
   If (MinLen>Capacity) then
     begin
-    DesLen:=(FCapacity*5) div 4;
+    DesLen:=(FCapacity*3) div 2;
     if DesLen>MinLen then
       MinLen:=DesLen;
     Capacity:=MinLen;