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

ext/bcmath: Extracted common logic into function and macro #18103

Merged
merged 3 commits into from
Mar 19, 2025

Conversation

SakiTakamachi
Copy link
Member

No description provided.

@SakiTakamachi SakiTakamachi force-pushed the bcmath/common_convert branch from e63d00a to a714f9f Compare March 18, 2025 02:33
@SakiTakamachi SakiTakamachi marked this pull request as ready for review March 18, 2025 04:47
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Looks fine, please see my comment

@@ -85,4 +85,29 @@ static inline void bc_convert_to_vector_with_zero_pad(BC_VECTOR *n_vector, const
bc_convert_to_vector(n_vector, nend, nlen);
}

static inline void bc_convert_vector_to_char(BC_VECTOR *vector, char *nptr, char *nend, size_t arr_size)
Copy link
Member

Choose a reason for hiding this comment

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

vector could be const.

Copy link
Member Author

Choose a reason for hiding this comment

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

@nielsdos
Indeed.
However, I discovered that in the final loop of the function, I was rewriting the vectors.
This is not good, so I copied the values ​​to another variable and made the vectors const.

cf98eb1

@SakiTakamachi SakiTakamachi merged commit fb07c62 into php:master Mar 19, 2025
9 checks passed
@SakiTakamachi SakiTakamachi deleted the bcmath/common_convert branch March 19, 2025 09:10
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