# sum_tree: Utilize \`size_hint\` in \`TreeSet::extend\` \(\#34936\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7db110f48d23344e1fc2fa9f30f6b1fe3878bc73

Requested commit: 7db110f48d23344e1fc2fa9f30f6b1fe3878bc73

Commit: 7db110f48d23344e1fc2fa9f30f6b1fe3878bc73

Tree: 846d8b1066992dc0126b5ff8bfa9623ba98ee7a6

Author: tidely

Committer: GitHub

## Message

```
sum_tree: Utilize `size_hint` in `TreeSet::extend` (#34936)

Collect the iterator instead of manually looping over it to utilize
possible size hints. Zed usually passes in owned `Vec`'s, meaning we get
to reuse memory as well.

Release Notes:

- N/A
```

## Parents

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

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