Skip to content

Commit ac52483

Browse files
mizdebskmkoncek
authored andcommitted
Deduplicate repeated branch body in conditional chain
Simplify control flow by merging two branches with identical bodies into a single condition. This removes redundancy and improves readability without changing behavior.
1 parent 9094abe commit ac52483

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/java_symbols.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,8 @@ inline std::ptrdiff_t find_token(std::string_view content, std::string_view toke
276276

277277
while (position < std::ssize(content) and content[position] != '"')
278278
{
279-
if (content.substr(position, 2) == "\\\\")
280-
{
281-
position += 2;
282-
}
283-
else if (content.substr(position, 2) == "\\\"")
279+
if (content.substr(position, 2) == "\\\\"
280+
or content.substr(position, 2) == "\\\"")
284281
{
285282
position += 2;
286283
}

0 commit comments

Comments
 (0)