# Fix panic when fuzzy-matching on a \`Worktree\` that contains no files · gitcafe/zed

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

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

Visibility: public

Requested revision: 8de8c679c72d57867714e9627a201de340b64cb6

Requested commit: 8de8c679c72d57867714e9627a201de340b64cb6

Commit: 8de8c679c72d57867714e9627a201de340b64cb6

Tree: ed93c7c6e8f1b43d1cc32b3a8ea40048e788a34a

Author: Antonio Scandurra

Committer: Max Brunsfeld

## Message

```
Fix panic when fuzzy-matching on a `Worktree` that contains no files

As part of our work on the deterministic executor, in c4e37dc we fixed a
bug that occurred when there were more CPUs than paths to fuzzy-match
on.

However, that introduced another bug that caused Zed to panic when
trying to calculate how many paths should be fuzzy-matched by each
available worker thread for worktrees that didn't contain any file.

This commit bails out early in `fuzzy::match_paths` if the vector of
paths to search is empty.

```

## Parents

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

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