# Use unstable sorts before deduplication \(\#63199\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f42c6e873eee375b94ec8684001a1d6eba8c3a2b

Requested commit: f42c6e873eee375b94ec8684001a1d6eba8c3a2b

Commit: f42c6e873eee375b94ec8684001a1d6eba8c3a2b

Tree: b9b546b64639fcb28b5a7fcb3697d858beb8c8c6

Author: Miguel Raz Guzmán Macedo

Committer: GitHub

## Message

````
Use unstable sorts before deduplication (#63199)

# Objective

Get some speedups by using unstable sortts.
Supersedes #58761 after rebasing onto current `main`.

## Solution

replace `.sort()` by `.unstable_sort()`.

## Testing

All tests pass in affected crates:

```
cargo test -p edit_prediction_context -p editor -p git -p language -p language_tools -p migrator
```

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- N/A
````

## Parents

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

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