# Speed up tab searching in \`TabMap::sync\` by looking for \`\\t\` only · gitcafe/zed

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

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

Visibility: public

Requested revision: af4c4c7cf032d41d437fce68e0bdfa42b070b3fc

Requested commit: af4c4c7cf032d41d437fce68e0bdfa42b070b3fc

Commit: af4c4c7cf032d41d437fce68e0bdfa42b070b3fc

Tree: 2ad0365e360a47e99e2aaf81a1e10064b9002acc

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Speed up tab searching in `TabMap::sync` by looking for `\t` only

Instead of looking for `\n` as a stopping condition, we cap the range
we pass to `SuggestionSnapshot::chunks` to stop on the next line. This
makes character searching faster, because looking for a single character
uses `memchr`. Also, this avoids an extra conditional in a tight loop such
as the chunk scanning one contained in `TabMap::sync`.

```

## Parents

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

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