Bug 12798 – constant folding should optimize subsequent concatenations
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-25T02:05:00Z
Last change time
2014-05-25T18:25:31Z
Keywords
performance, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2014-05-25T02:05:53Z
This is front-end optimizer issue.
Preceding concatenations of string literals will be optimized to one long literal.
string x;
string y = "a" ~ "b" ~ x; // optimized to "ab" ~ x
But subsequent one doesn't.
string z = x ~ "a" ~ "b"; // not optimized to x ~ "ab"