Skip to content

Update countLines for improved accuracy#2542

Merged
knadh merged 2 commits intoknadh:masterfrom
howardah:update-import-count
Jun 30, 2025
Merged

Update countLines for improved accuracy#2542
knadh merged 2 commits intoknadh:masterfrom
howardah:update-import-count

Conversation

@howardah
Copy link
Contributor

Closes issue #2541

Just a small change to the countLines function which just checks if the last byte is a line break (\n) and adds one to the total count if it's not. This means that the row count remains more accurate if there is no trailing line break.

This does not introduce any logic to distinguish between "blank" and non "blank" lines and therefore still does not guarantee an accurate row count (even just in the case of multiple trailing line breaks), but does approach a more accurate row count.

@knadh knadh merged commit 419f88a into knadh:master Jun 30, 2025
bobbyseamoss pushed a commit to bobbyseamoss/listmonk that referenced this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants