Skip to content

Conversation

@stenlarsson
Copy link
Contributor

@stenlarsson stenlarsson commented Dec 14, 2025

Rationale for this change

The ReplaceSliceOptions class is not available in GLib/Ruby, and it is used together with the utf8_replace_slice compute function.

What changes are included in this PR?

This adds the ReplaceSliceOptions class to GLib.

Are these changes tested?

Yes, with Ruby unit tests.

Are there any user-facing changes?

Yes, a new class.

@stenlarsson stenlarsson requested a review from kou as a code owner December 14, 2025 15:52
@github-actions
Copy link

⚠️ GitHub issue #48500 has been automatically assigned in GitHub to PR creator.

Comment on lines 7148 to 7153
const gchar *replacement = g_value_get_string(value);
if (priv->replacement) {
g_free(priv->replacement);
}
priv->replacement = g_strdup(replacement);
options->replacement = replacement ? replacement : "";
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need priv->replacement?
It seems that we can just use options->replacement = g_value_get_string(value).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that simplifies the implementation.

@stenlarsson stenlarsson force-pushed the glib-replace-slice-options branch from abdf3bd to 4230f0e Compare December 27, 2025 10:46
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants