# std.unicode: Fix ArrayList functions when using populated ArrayLists · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/84f4c5d9ccbebb6675c7366c4e1fdb661003356e)

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

Visibility: public

Requested revision: 84f4c5d9ccbebb6675c7366c4e1fdb661003356e

Requested commit: 84f4c5d9ccbebb6675c7366c4e1fdb661003356e

Commit: 84f4c5d9ccbebb6675c7366c4e1fdb661003356e

Tree: 52c35bf6456f5a26e3e4a2083d2b62e772770642

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
std.unicode: Fix ArrayList functions when using populated ArrayLists

ensureTotalCapacityPrecise only satisfies the assumptions made in the ArrayListImpl functions (that there's already enough capacity for the entire converted string if it's all ASCII) when the ArrayList has no items, otherwise it would hit illegal behavior.

```

## Parents

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

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