https://d.puremagic.com/issues/show_bug.cgi?id=11830

           Summary: std.stdio.byLine reports extra line if you don't call
                    .front
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Peter Alexander <[email protected]> 2013-12-27 
10:19:03 PST ---
If you don't call 'front' while iterating a ByLine range, you get a different
number of elements.

import std.stdio;
import std.range;
import std.algorithm;
void main()
{
    File("stuff", "w").write("line 1\nline 2\n");
    writeln(File("stuff").byLine.walkLength);
    writeln(File("stuff").byLine.filter!"true".walkLength);
}

This prints:

3
2

This should print 2 in both cases.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to