# InternPool: avoid indexToKey recursion for type_enum_auto · gitcafe/zig

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

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

Visibility: public

Requested revision: 66f83f27a2904180bae7797a7c87c6eddc7eebff

Requested commit: 66f83f27a2904180bae7797a7c87c6eddc7eebff

Commit: 66f83f27a2904180bae7797a7c87c6eddc7eebff

Tree: bd3ef82451b2f04d720d84a9ed44c32d54c78455

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
InternPool: avoid indexToKey recursion for type_enum_auto

Recursion makes this hot function more difficult to profile and
optimize.

This commit adds the integer tag type to the type_enum_auto encoding
even though the integer tag type can be inferred based on the number of
fields of the enum. This avoids a call to getAssumeExists of the integer
tag type inside indexToKey.

```

## Parents

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

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