Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn if result of ts_set_flags_32 is not used #5856

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ ts_flags_are_set_32(uint32 bitmap, uint32 flags)
return (bitmap & flags) == flags;
}

static inline uint32
static inline pg_nodiscard uint32
ts_set_flags_32(uint32 bitmap, uint32 flags)
{
return bitmap | flags;
Comment on lines +172 to 175
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should just replace it with |=?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also thought about modifying the value directly. But then decided against it to have a function signature that is similar to other PostgreSQL functions like lappend().

Copy link
Member

Choose a reason for hiding this comment

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

No, I mean, remove the function altogether. Anyway, with your change it's better.

Expand Down