# Make \`std.PriorityQueue\` an unmanaged container \(\#31299\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 4e2cec265d37afd5ad320d0430060308de65326f

Requested commit: 4e2cec265d37afd5ad320d0430060308de65326f

Commit: 4e2cec265d37afd5ad320d0430060308de65326f

Tree: 3ca62b6279e6af3756d83b6d8296f7d3d83e3330

Author: Saurabh Mishra

Committer: Andrew Kelley

## Message

````
Make `std.PriorityQueue` an unmanaged container (#31299)

## Summary of changes

+ Make adjustments to the `allocator` field and ensure the below tests pass:

  ```sh
  zig test lib/std/std.zig --zig-lib-dir lib
  zig build test-std -Dno-matrix --summary all
  ```

+ Rename `add` to `push` and `remove` to `pop` in methods and tests

+ Incorporate the functionality of `pop` in `popOrNull`, then rename the `popOrNull` to `pop` and update tests

+ Use `.empty` to set default field values and rename the `init` method to `initContext`

+ Improve variable types in tests: min heap uses the less than context function and max heap uses greater than context function

+ Remove the `dump` method as its not being used anywhere

+ Document methods `clearRetainingCapacity`, `clearAndFree`, `update`, and `ensureTotalCapacityPrecise`

Closes https://codeberg.org/ziglang/zig/issues/31298

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31299
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Saurabh Mishra <saurabh.m@proton.me>
Co-committed-by: Saurabh Mishra <saurabh.m@proton.me>

````

## Parents

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

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