# std.debug: optimized printLineFromFileAnyOs \(\#18142\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/22d7c7d2953360afb29ed2c60185bb0bba32cc30)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 22d7c7d2953360afb29ed2c60185bb0bba32cc30

Requested commit: 22d7c7d2953360afb29ed2c60185bb0bba32cc30

Commit: 22d7c7d2953360afb29ed2c60185bb0bba32cc30

Tree: 9b9592e038e5fd68755cb8c100804afd2bb25385

Author: tjog

Committer: GitHub

## Message

```
std.debug: optimized printLineFromFileAnyOs (#18142)

* std.debug: optimized printLineFromFileAnyOs

Uses mem.indexOfScalar to speed line iteration instead of byte for byte.
Also prints the whole line in a single write (or up to a page size at a
time)

Closes #18099

* add test cases for printLineFromFileAnyOs
```

## Parents

- [2a322645331532e22def160677a345854f00b7e2](https://git.cafe/gitcafe/zig/commit/2a322645331532e22def160677a345854f00b7e2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/22d7c7d2953360afb29ed2c60185bb0bba32cc30?format=markdown)
