# Minor optimization of line number length logic \(\#26845\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ef91e7afae47d6ec2b1169e7948be768d257d981)

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

Visibility: public

Requested revision: ef91e7afae47d6ec2b1169e7948be768d257d981

Requested commit: ef91e7afae47d6ec2b1169e7948be768d257d981

Commit: ef91e7afae47d6ec2b1169e7948be768d257d981

Tree: 52aba262723245c08e177596e9ead9cb59ad5fc4

Author: Michael Sloan

Committer: GitHub

## Message

```
Minor optimization of line number length logic (#26845)

In `layout_excerpt_gutter`, compute max line number length once instead
of for every row

In `max_line_number_width`, use ilog10 instead of converting to floats
and back

Release Notes:

- N/A
```

## Parents

- [c220fb387d0b2bd846ae10e7060c786cfbfc7e54](https://git.cafe/gitcafe/zed/commit/c220fb387d0b2bd846ae10e7060c786cfbfc7e54?format=markdown)

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