# Move \`compareFn\` from init to type constructor in \`PriorityQueue\` and \`PriorityDequeue\`\. · gitcafe/zig

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

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

Visibility: public

Requested revision: 53b87fa78a3ee2c261f3bdd6a71d5733fe17ffd5

Requested commit: 53b87fa78a3ee2c261f3bdd6a71d5733fe17ffd5

Commit: 53b87fa78a3ee2c261f3bdd6a71d5733fe17ffd5

Tree: c3ff20f7501d461adf58ccb817f10566c9192cd1

Author: Max Hollmann

Committer: Andrew Kelley

## Message

```
Move `compareFn` from init to type constructor in `PriorityQueue` and `PriorityDequeue`.
This change significantly improves performance for simple compare functions and modifies
the API to be more consistent with e.g. `HashMap`.

```

## Parents

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

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