DEV Community

Discussion on: Global Mutable State

Collapse
 
luolong profile image
Roland Tepp

Maybe it's just me, but aren't you first counting lines of a file and then iterating over each line in the same file and appending line count to each line? Effectively reading through the file twice.

Looks like a bug to me...