File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -643,12 +643,6 @@ namespace tiny_utf8
643
643
data{ value , ' \0 ' }
644
644
, data_len( (unsigned char )( size - 1u ) << 1 )
645
645
{}
646
- SSO ( size_type data_len ) noexcept :
647
- // Note: No initialization of .data (important for the constructor of basic_string(value_type)...)
648
- data_len ( (unsigned char )( ( size - data_len ) << 1 ) )
649
- {
650
- data[data_len] = ' \0 ' ; // Add delimiter to actual data
651
- }
652
646
SSO () noexcept :
653
647
data{ ' \0 ' }
654
648
, data_len( (unsigned char )( size - 0 ) << 1 )
@@ -1246,8 +1240,10 @@ namespace tiny_utf8
1246
1240
explicit inline basic_string ( value_type cp , const allocator_type& alloc = allocator_type() )
1247
1241
noexcept (TINY_UTF8_NOEXCEPT)
1248
1242
: Allocator( alloc )
1249
- , t_sso( (size_type)encode_utf8( cp , t_sso.data ) )
1250
- {}
1243
+ {
1244
+ t_sso.data [ cp = encode_utf8 ( cp , t_sso.data ) ] = ' \0 ' ;
1245
+ set_sso_data_len ( cp );
1246
+ }
1251
1247
/* *
1252
1248
* Constructor that fills the string with the supplied character
1253
1249
*
You can’t perform that action at this time.
0 commit comments