Skip to content

Commit ef1cd79

Browse files
Copilotnunoplopes
andauthored
refactor: remove unnecessary empty check in ReplaceAll
Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/73fb334b-46a8-4ab4-96ed-332380c8dcdf Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
1 parent fbcf7a1 commit ef1cd79

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

cpp2rust/converter/converter_lib.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,6 @@ void Unwrap(std::string &s, std::string_view prefix, std::string_view suffix) {
764764

765765
std::string ReplaceAll(std::string str, std::string_view from,
766766
std::string_view to) {
767-
if (from.empty())
768-
return str;
769767
size_t pos = 0;
770768
while ((pos = str.find(from, pos)) != std::string::npos) {
771769
str.replace(pos, from.size(), to);

0 commit comments

Comments
 (0)