[Issue 12798] New: constant folding should optimize subsequent concatenations
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat May 24 19:05:53 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12798
Issue ID: 12798
Summary: constant folding should optimize subsequent
concatenations
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: performance
Severity: major
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: k.hara.pg at gmail.com
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"
--
More information about the Digitalmars-d-bugs
mailing list