refactor(clp-s): Replace clp_s::StringUtils function calls with clp::string_utils equivalents and remove redundant implementations.#1103
Merged
gibber9809 merged 2 commits intoJul 16, 2025
Conversation
…ons in clp::string_utils.
Contributor
## Walkthrough
This change removes a large set of string utility functions from the `StringUtils` class and replaces their usage with the external `clp::string_utils` library. It updates CMake dependencies to require and link against `clp::string_utils` for relevant targets and adjusts code to use the new namespace and headers.
## Changes
| File(s) | Change Summary |
|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| components/core/cmake/Options/options.cmake | Added `CLP_BUILD_CLP_STRING_UTILS` as a required dependency for `CLP_BUILD_CLP_S_ARCHIVEREADER` and `CLP_BUILD_CLP_S_SEARCH`. |
| components/core/src/clp_s/CMakeLists.txt | Added `clp::string_utils` as a public dependency for `clp_s_archive_reader`. |
| components/core/src/clp_s/search/CMakeLists.txt | Added `clp::string_utils` as a private dependency for `clp_s_search`. |
| components/core/src/clp_s/Utils.cpp, components/core/src/clp_s/Utils.hpp | Removed string utility methods from `StringUtils` and replaced internal calls with `clp::string_utils` equivalents. |
| components/core/src/clp_s/DictionaryReader.hpp | Updated wildcard matching to use `clp::string_utils::wildcard_match_unsafe` and changed header include accordingly. |
| components/core/src/clp_s/search/QueryRunner.cpp | Replaced `StringUtils::wildcard_match_unsafe` usages with `clp::string_utils::wildcard_match_unsafe`; updated includes.|
| components/core/src/clp_s/search/clp_search/Grep.cpp | Replaced all `StringUtils` utility calls with `clp::string_utils` equivalents; updated header include. |
## Possibly related PRs
- [y-scope/clp#754](https://github.com/y-scope/clp/pull/754): Refactored string utility functions out of `StringUtils` and reorganized them, similar to the modularization in this PR.
- [y-scope/clp#955](https://github.com/y-scope/clp/pull/955): Introduced the build flag and dependency validation infrastructure that this PR extends for `clp::string_utils`.
- [y-scope/clp#930](https://github.com/y-scope/clp/pull/930): Related to string conversion utilities in `clp::string_utils` used by this PR.
## Suggested reviewers
- kirkrodrigues
- haiqi96📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
wraymo
approved these changes
Jul 16, 2025
clp_s::StringUtils functions that have equivalent implementations in clp::string_utils.clp_s::StringUtils methods with clp::string_utils equivalents and remove redundant implementations.
kirkrodrigues
approved these changes
Jul 16, 2025
kirkrodrigues
left a comment
Member
There was a problem hiding this comment.
Deferring to @wraymo's review.
clp_s::StringUtils methods with clp::string_utils equivalents and remove redundant implementations.clp_s::StringUtils function calls with clp::string_utils equivalents and remove redundant implementations.
3 tasks
3 tasks
3 tasks
3 tasks
junhaoliao
pushed a commit
to junhaoliao/clp
that referenced
this pull request
May 17, 2026
…p::string_utils` equivalents and remove redundant implementations. (y-scope#1103)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR deletes functions in
clp_s::StringUtilsthat were copied fromclp::string_utils. Deleting these copied functions will simplify performance work and bug-fixes, since for these deduplicated functions we now only need to make changes in one place.Some functions in
clp_s::StringUtilscan not be deleted as part of this PR (get_bounds_of_next_varand related functions) since they are currently used for the copied version of the core CLP encoding logic. When we de-duplicate this core encoding logic we can also delete theseclp::StringUtilsfunctions.Checklist
breaking change.
Validation performed
Summary by CodeRabbit
Summary by CodeRabbit