mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 06:26:10 +02:00
* Patch with some micro-optimizations. Fixes issue #40378
This commit is contained in:
parent
4561d8982f
commit
8539a8b727
@ -207,7 +207,7 @@ begin
|
|||||||
Result.Bookmark := Copy(s, i + 1, MaxInt);
|
Result.Bookmark := Copy(s, i + 1, MaxInt);
|
||||||
if Decode then
|
if Decode then
|
||||||
Result.Bookmark:=Unescape(Result.Bookmark);
|
Result.Bookmark:=Unescape(Result.Bookmark);
|
||||||
s := Copy(s, 1, i - 1);
|
SetLength(s, i - 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Extract the params
|
// Extract the params
|
||||||
@ -218,7 +218,7 @@ begin
|
|||||||
Result.Params := Copy(s, i + 1, MaxInt);
|
Result.Params := Copy(s, i + 1, MaxInt);
|
||||||
if Decode then
|
if Decode then
|
||||||
Result.Params:=Unescape(Result.Params);
|
Result.Params:=Unescape(Result.Params);
|
||||||
s := Copy(s, 1, i - 1);
|
SetLength(s, i - 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// extract authority
|
// extract authority
|
||||||
@ -248,7 +248,7 @@ begin
|
|||||||
if Decode then
|
if Decode then
|
||||||
Result.Document:=Unescape(Result.Document);
|
Result.Document:=Unescape(Result.Document);
|
||||||
if (Result.Document <> '.') and (Result.Document <> '..') then
|
if (Result.Document <> '.') and (Result.Document <> '..') then
|
||||||
s := Copy(s, 1, i)
|
SetLength(s, i)
|
||||||
else
|
else
|
||||||
Result.Document := '';
|
Result.Document := '';
|
||||||
break;
|
break;
|
||||||
@ -287,7 +287,7 @@ begin
|
|||||||
if PortValid then
|
if PortValid then
|
||||||
begin
|
begin
|
||||||
Result.Port := StrToInt(Copy(Authority, i + 1, MaxInt));
|
Result.Port := StrToInt(Copy(Authority, i + 1, MaxInt));
|
||||||
Authority := Copy(Authority, 1, i - 1);
|
SetLength(Authority, i - 1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -296,11 +296,11 @@ begin
|
|||||||
i := Pos('@', Authority);
|
i := Pos('@', Authority);
|
||||||
if i > 0 then
|
if i > 0 then
|
||||||
begin
|
begin
|
||||||
Result.Host := Copy(Authority, i+1, MaxInt);
|
Result.Host := Copy(Authority, i + 1, MaxInt);
|
||||||
Delete(Authority, i, MaxInt);
|
SetLength(Authority, i - 1);
|
||||||
|
|
||||||
// Extract username and password
|
// Extract username and password
|
||||||
if Length(Authority) > 0 then
|
if Authority <> '' then
|
||||||
begin
|
begin
|
||||||
i := Pos(':', Authority);
|
i := Pos(':', Authority);
|
||||||
if i = 0 then
|
if i = 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user