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

Add rz_vector_assign_at() #4373

Closed
wants to merge 1 commit into from
Closed

Add rz_vector_assign_at() #4373

wants to merge 1 commit into from

Conversation

Rot127
Copy link
Member

@Rot127 Rot127 commented Mar 21, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

Adds a rz_vector_assign_at() function.

Test plan

Added.

Closing issues

...

@Rot127 Rot127 changed the title Add rz_vector_index_ptr() Add rz_vector_assign_at() Mar 21, 2024
@Rot127 Rot127 mentioned this pull request Mar 21, 2024
13 tasks
Rot127 added a commit to Rot127/rizin that referenced this pull request Mar 21, 2024
*
* \return The pointer stored at \p index before. Or NULL in case of failure.
*/
RZ_API void *rz_pvector_assign_at(RZ_BORROW RZ_NONNULL RzPVector *vec, size_t index, RZ_OWN RZ_NONNULL void *ptr) {
Copy link
Member

Choose a reason for hiding this comment

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

why you need this when rz_pvector_set is available?

Copy link
Member Author

Choose a reason for hiding this comment

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

rz_pvector_set is private. My thinking was, that it is better to have an equivalent function to the normal rz_vector_assign_at. So we don't mix up names with function between RzVector and RzPVector.

Copy link
Member

Choose a reason for hiding this comment

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

well, it's an inline within the headers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Something is wrong with this week -.-
Yeah, it is not necessary to add it than. rz_pvector_get and rz_pvector_set is good enough. Let me close this one.

Copy link
Member

@wargio wargio left a comment

Choose a reason for hiding this comment

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

.

@Rot127 Rot127 closed this Mar 22, 2024
@Rot127 Rot127 deleted the pvec-assign branch March 22, 2024 05:19
Rot127 added a commit to Rot127/rizin that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants