Merged
Conversation
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Member
Author
This was referenced Jun 8, 2019
| std::string output = input; | ||
| const std::size_t find_len = find.length(); | ||
| const std::size_t replace_len = replace.length(); | ||
| if (0u == find_len) { |
There was a problem hiding this comment.
We can also check if 0u == input.length() here.
Member
Author
There was a problem hiding this comment.
Would this improve anything? We won't enter the while-loop anyways.
prajakta-gokhale
approved these changes
Jun 10, 2019
prajakta-gokhale
left a comment
There was a problem hiding this comment.
Few minor suggestions and nitpicks, looks good otherwise.
wjwwood
approved these changes
Jun 10, 2019
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
9fe5c66 to
eb1ec92
Compare
wjwwood
reviewed
Jun 11, 2019
Signed-off-by: William Woodall <william@osrfoundation.org>
wjwwood
reviewed
Jun 11, 2019
| FindT && find, | ||
| ReplaceT && replace) | ||
| { | ||
| auto input_str = detail::normalize_to_basic_string(input); |
Member
There was a problem hiding this comment.
There is one limitation here which is that the three argument normalize to the same char typed basic_string. Which I think is fine.
Member
Author
There was a problem hiding this comment.
Yeah, I think that's okay.
wjwwood
approved these changes
Jun 11, 2019
Member
Author
Member
Author
jacobperron
added a commit
that referenced
this pull request
Jul 26, 2019
* Add function 'find_and_replace' Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Fix spelling Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add shortcut for find == replace Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Template on std::basic_string Signed-off-by: Jacob Perron <jacob@openrobotics.org> * changed find_and_replace to accept literals using magic 🌈✨ Signed-off-by: William Woodall <william@osrfoundation.org> * Fix lint Signed-off-by: Jacob Perron <jacob@openrobotics.org>
jacobperron
added a commit
that referenced
this pull request
Jul 26, 2019
* Add function 'find_and_replace' Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Fix spelling Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Add shortcut for find == replace Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Template on std::basic_string Signed-off-by: Jacob Perron <jacob@openrobotics.org> * changed find_and_replace to accept literals using magic 🌈✨ Signed-off-by: William Woodall <william@osrfoundation.org> * Fix lint Signed-off-by: Jacob Perron <jacob@openrobotics.org>
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.
This will be used for improvements related to ros2/rmw_fastrtps#277.