Skip to content

Commit

Permalink
style: format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovelylavender4 committed Mar 16, 2024
1 parent 46c8f33 commit 446890f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions iVerse/include/string/iString.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ namespace String
else { basic_string::replace(pos, oldString.length(), newString.data()); }
pos = forward ? basic_string::find(
oldString.data(),
pos + newString.length() + oldString.empty() ? 1 : 0
pos + newString.length() + oldString.empty() ? (Index)1 : (Index)0
)
: basic_string::rfind(oldString.data(), pos - oldString.empty() ? 1 : 0);
: basic_string::rfind(
oldString.data(),
pos - oldString.empty() ? (Index)1 : (Index)0
);
}
return *this;
}
Expand Down Expand Up @@ -169,8 +172,11 @@ namespace String
}
else { c++; }
pos = forward
? basic_string::find(string.data(), pos + string.length() + string.empty() ? 1 : 0)
: basic_string::rfind(string.data(), pos - string.empty() ? 1 : 0);
? basic_string::find(
string.data(),
pos + string.length() + string.empty() ? (Index)1 : (Index)0
)
: basic_string::rfind(string.data(), pos - string.empty() ? (Index)1 : (Index)0);
}
return c;
}
Expand Down Expand Up @@ -202,8 +208,9 @@ namespace String
}
}
else { basic_string::replace(pos, string.length(), u8""); }
pos = forward ? basic_string::find(string.data(), pos + string.empty() ? 1 : 0)
: basic_string::rfind(string.data(), pos - string.empty() ? 1 : 0);
pos = forward
? basic_string::find(string.data(), pos + string.empty() ? (Index)1 : (Index)0)
: basic_string::rfind(string.data(), pos - string.empty() ? (Index)1 : (Index)0);
}
return *this;
}
Expand Down

0 comments on commit 446890f

Please sign in to comment.