Skip to content

Remove unnecessary empty-string guard and move ReplaceAll out of header#40

Merged
nunoplopes merged 5 commits intomasterfrom
copilot/replace-std-regex-replace
Apr 29, 2026
Merged

Remove unnecessary empty-string guard and move ReplaceAll out of header#40
nunoplopes merged 5 commits intomasterfrom
copilot/replace-std-regex-replace

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

ReplaceAll was defined inline in converter_lib.h and contained an unnecessary early-return guard for an empty from argument.

Changes

  • converter_lib.h: Replace inline definition with a plain declaration
  • converter_lib.cpp: Add ReplaceAll definition; drop the if (from.empty()) return str; guard — str.find("", pos) never returns npos, so the loop body would never execute anyway, making the check redundant

@nunoplopes nunoplopes marked this pull request as ready for review April 28, 2026 20:50
@nunoplopes nunoplopes merged commit 4bce2c7 into master Apr 29, 2026
9 checks passed
@nunoplopes nunoplopes deleted the copilot/replace-std-regex-replace branch April 29, 2026 07:20
Copilot AI added a commit that referenced this pull request Apr 29, 2026
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants