Skip to content

Commit

Permalink
remove unnecessary branch in string serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Jul 5, 2024
1 parent ccc7ff4 commit e683cb1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/boost/json/impl/serializer.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ do_str2:

// slow loop,
// handle escapes
if( false )
{
do_esc1:
BOOST_ASSERT(ss);
ss.append(buf_[0]);
}

do_str3:
while(BOOST_JSON_LIKELY(ss))
{
Expand Down Expand Up @@ -351,13 +358,6 @@ do_str3:
}
return suspend(state::str3);

do_esc1:
if(BOOST_JSON_LIKELY(ss))
ss.append(buf_[0]);
else
return suspend(state::esc1);
goto do_str3;

do_utf1:
if(BOOST_JSON_LIKELY(ss))
ss.append('u');
Expand Down

0 comments on commit e683cb1

Please sign in to comment.