# Improve performance of go-to-diagnostic when many diagnostics are present \(\#23166\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 74620e611ed5546e74b28cf194644449a74d4404

Requested commit: 74620e611ed5546e74b28cf194644449a74d4404

Commit: 74620e611ed5546e74b28cf194644449a74d4404

Tree: 5800dc815dc64e237d58106b8ac592b6f34034c3

Author: Cole Miller

Committer: GitHub

## Message

```
Improve performance of go-to-diagnostic when many diagnostics are present (#23166)

Instead of eagerly calling `to_offset` on the anchor ranges for each
diagnostic in the direction of the search, work lazily in terms of
anchors and convert to offsets at the very end.

Release Notes:

- N/A
```

## Parents

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

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