mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 08:29:29 +02:00
* optimize shortstring concatenations if they're on the right side of an assignment to directly use the left side instead of a temporary
This commit is contained in:
parent
32261a0f6d
commit
02aac653d2
@ -3382,7 +3382,13 @@ implementation
|
||||
{ create the call to the concat routine both strings as arguments }
|
||||
if assigned(aktassignmentnode) and
|
||||
(aktassignmentnode.right=self) and
|
||||
(aktassignmentnode.left.resultdef=resultdef) and
|
||||
(
|
||||
(aktassignmentnode.left.resultdef=resultdef) or
|
||||
(
|
||||
is_shortstring(aktassignmentnode.left.resultdef) and
|
||||
is_shortstring(resultdef)
|
||||
)
|
||||
) and
|
||||
valid_for_var(aktassignmentnode.left,false) then
|
||||
begin
|
||||
para:=ccallparanode.create(
|
||||
|
@ -341,7 +341,13 @@ begin
|
||||
arrp.allow_array_constructor:=true;
|
||||
if assigned(aktassignmentnode) and
|
||||
(aktassignmentnode.right=p) and
|
||||
(aktassignmentnode.left.resultdef=p.resultdef) and
|
||||
(
|
||||
(aktassignmentnode.left.resultdef=p.resultdef) or
|
||||
(
|
||||
is_shortstring(aktassignmentnode.left.resultdef) and
|
||||
is_shortstring(p.resultdef)
|
||||
)
|
||||
) and
|
||||
valid_for_var(aktassignmentnode.left,false) then
|
||||
begin
|
||||
para:=ccallparanode.create(
|
||||
|
Loading…
Reference in New Issue
Block a user