# fuzzy_nucleo: Fix out of range panic \(\#54371\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 81b16f464ce91e40c1c645b56675c26ee0b2b6c4

Requested commit: 81b16f464ce91e40c1c645b56675c26ee0b2b6c4

Commit: 81b16f464ce91e40c1c645b56675c26ee0b2b6c4

Tree: 4d3b5b47cec290c06afad2563523aa09e5cc432f

Author: Finn Evers

Committer: GitHub

## Message

```
fuzzy_nucleo: Fix out of range panic (#54371)

Closes ZED-6PK

The issue here was that we could hit cases where the amount of segments
< amount of CPUs, e.g. for 5 candidates and 4 CPUs, we would have 2
candidates per matcher, so for the fourth matcher, we would start
slicing at 3 * 2 = 6 > 5, which is out of bounds.

Instead, make it so that we distribute the candidates across all
matchers so that all matchers have either n or n + 1 candidates.

No release notes since this is only on Nightly.

Release Notes:

- N/A
```

## Parents

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

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