mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* made inster(string,string,index) a bit faster
+ overloaded insert(char,string,index)
This commit is contained in:
parent
5de65a9810
commit
f7b137cdef
@ -60,7 +60,21 @@ begin
|
||||
dec(index)
|
||||
else
|
||||
index:=0;
|
||||
s:=Copy(s,1,Index)+source+Copy(s,Index+1,length(s));
|
||||
{ s:=Copy(s,1,Index)+source+Copy(s,Index+1,length(s));}
|
||||
move(s[Index+1],s[Index+Length(Source)+1], Length(s)-Index);
|
||||
move(Source[1],s[Index+1],Length(Source));
|
||||
Inc(Byte(s[0]),Byte(source[0]));
|
||||
end;
|
||||
|
||||
procedure insert(source : Char;var s : shortstring;index : StrLenInt);
|
||||
begin
|
||||
if index>1 then
|
||||
dec(index)
|
||||
else
|
||||
index:=0;
|
||||
move(s[Index+1],s[Index+2], Length(s)-Index);
|
||||
s[Index+1] := Source;
|
||||
Inc(Byte(s[0]));
|
||||
end;
|
||||
|
||||
|
||||
@ -937,7 +951,11 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.17 1998-12-15 22:43:02 peter
|
||||
Revision 1.18 1999-01-11 19:26:55 jonas
|
||||
* made inster(string,string,index) a bit faster
|
||||
+ overloaded insert(char,string,index)
|
||||
|
||||
Revision 1.17 1998/12/15 22:43:02 peter
|
||||
* removed temp symbols
|
||||
|
||||
Revision 1.16 1998/11/05 10:29:34 pierre
|
||||
|
@ -188,6 +188,7 @@ function strlen(p:pchar):longint;
|
||||
Function Copy(const s:shortstring;index:StrLenInt;count:StrLenInt):shortstring;
|
||||
Procedure Delete(Var s:shortstring;index:StrLenInt;count:StrLenInt);
|
||||
Procedure Insert(const source:shortstring;Var s:shortstring;index:StrLenInt);
|
||||
Procedure Insert(source:Char;Var s:shortstring;index:StrLenInt);
|
||||
Function Pos(const substr:shortstring;const s:shortstring):StrLenInt;
|
||||
Function Pos(C:Char;const s:shortstring):StrLenInt;
|
||||
Procedure SetLength(var s:shortstring;len:StrLenInt);
|
||||
@ -430,7 +431,11 @@ const
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.46 1998-12-28 15:50:48 peter
|
||||
Revision 1.47 1999-01-11 19:26:53 jonas
|
||||
* made inster(string,string,index) a bit faster
|
||||
+ overloaded insert(char,string,index)
|
||||
|
||||
Revision 1.46 1998/12/28 15:50:48 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user