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"
Comment #1 by k.hara.pg — 2014-05-25T02:55:25Z
Comment #2 by github-bugzilla — 2014-05-25T18:25:31Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5920f0953c9e7f4683d8c6f90a15497c95870076 fix Issue 12798 - constant folding should optimize subsequent concatenations https://github.com/D-Programming-Language/dmd/commit/99ccc90d669d92af80a55a509abfc09e1cafac8e Merge pull request #3581 from 9rnsr/fix12798 Issue 12798 - constant folding should optimize subsequent concatenations