# gpui: Avoid redundant SharedString allocations in ShapedLine::split_at \(\#54583\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 43d6ab5386ef5c4593d31a215396eaffe3d650f7

Requested commit: 43d6ab5386ef5c4593d31a215396eaffe3d650f7

Commit: 43d6ab5386ef5c4593d31a215396eaffe3d650f7

Tree: 597a56ed4b5da5d56d159766807a1da8309fd696

Author: Xiaobo Liu

Committer: GitHub

## Message

```
gpui: Avoid redundant SharedString allocations in ShapedLine::split_at (#54583)

Build split text directly from Arc<str> slices instead of allocating
intermediate Strings. Reuse the original SharedString for full-line
splits, return a static empty string for empty sides, and add a
regression test covering boundary splits.

Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
```

## Parents

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

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