Skip to content

Remove unnecessary structs for BSON MinKey and MaxKey classes#1999

Merged
alcaeus merged 1 commit into
mongodb:v2.xfrom
alcaeus:remove-bson-key-structs
Apr 27, 2026
Merged

Remove unnecessary structs for BSON MinKey and MaxKey classes#1999
alcaeus merged 1 commit into
mongodb:v2.xfrom
alcaeus:remove-bson-key-structs

Conversation

@alcaeus
Copy link
Copy Markdown
Member

@alcaeus alcaeus commented Apr 27, 2026

Missed these empty structs when cleaning up structs and class declarations in #1992.

Copilot AI review requested due to automatic review settings April 27, 2026 12:20
@alcaeus alcaeus requested a review from a team as a code owner April 27, 2026 12:20
@alcaeus alcaeus requested review from GromNaN and removed request for a team April 27, 2026 12:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the cleanup from #1992 by removing now-unnecessary internal structs and per-class object handlers for the BSON MinKey and MaxKey classes, relying on default Zend object allocation instead.

Changes:

  • Remove the empty phongo_maxkey_t and phongo_minkey_t struct typedefs.
  • Switch MAXKEY/MINKEY class declarations from PHONGO_DECLARE_CLASS_WITH_HELPERS to PHONGO_DECLARE_CLASS.
  • Drop custom create_object/handlers boilerplate in src/BSON/MinKey.c and src/BSON/MaxKey.c.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/phongo_structs.h Removes empty struct typedefs for MinKey/MaxKey.
src/phongo_classes.h Updates class declarations to no longer require struct-based helper macros.
src/BSON/MinKey.c Removes custom object handlers and create_object hook; keeps only class registration.
src/BSON/MaxKey.c Removes custom object handlers and create_object hook; keeps only class registration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less code is a great feature!

@alcaeus alcaeus enabled auto-merge (squash) April 27, 2026 12:31
@alcaeus alcaeus merged commit 5df115a into mongodb:v2.x Apr 27, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants