mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +02:00
fcl-js: jswriter: allow overriding Writing, less grows(faster and less allocations)
git-svn-id: trunk@36599 -
This commit is contained in:
parent
22ae3cd186
commit
a66eaa4769
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user