# fmt: Refactor parsing of placeholders into its own function · gitcafe/zig

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

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

Visibility: public

Requested revision: 1676729c66784a0e14e80f59454625c7d77f95d9

Requested commit: 1676729c66784a0e14e80f59454625c7d77f95d9

Commit: 1676729c66784a0e14e80f59454625c7d77f95d9

Tree: 4fc5dbd751a76f93f7ad39cca0e72a3d134a8ee1

Author: Jimmi Holst Christensen

Committer: Andrew Kelley

## Message

```
fmt: Refactor parsing of placeholders into its own function

This saves on comptime format string parsing, as the compiler caches
comptime calls. The catch here, is that parsePlaceHolder cannot take the
placeholder string as a slice. It must take it as an array by value for
the caching to occure.

There is also some logic in here that ensures that the specifier_arg is
always them same slice when the items they contain are the same. This
makes the compiler stamp out less copies of formatType.

```

## Parents

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

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