Bug 19469 – File.byLine reuses buffer

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-12-08T13:13:16Z
Last change time
2019-05-23T10:19:37Z
Assigned to
No Owner
Creator
Yuxuan Shui

Comments

Comment #0 by yshuiv7 — 2018-12-08T13:13:16Z
For example: stdin.byLine.array; Will give you an array of the same string. Although this is the correct behavior, it will surprise someone who is new to the language. I think we should make byLine duplicate the string by default.
Comment #1 by greeenify — 2018-12-08T14:58:00Z
The solution is to use byLineCopy. I think it's to late to change the default. Only the documentation can be improved.