@@ -122,12 +122,6 @@ static VALUE rstring_cache_fetch(rvalue_cache *cache, const char *str, const lon
122122 }
123123 }
124124
125- if (RB_UNLIKELY (memchr (str , '\\' , length ))) {
126- // We assume the overwhelming majority of names don't need to be escaped.
127- // But if they do, we have to fallback to the slow path.
128- return Qfalse ;
129- }
130-
131125 VALUE rstring = build_interned_string (str , length );
132126
133127 if (cache -> length < JSON_RVALUE_CACHE_CAPA ) {
@@ -174,12 +168,6 @@ static VALUE rsymbol_cache_fetch(rvalue_cache *cache, const char *str, const lon
174168 }
175169 }
176170
177- if (RB_UNLIKELY (memchr (str , '\\' , length ))) {
178- // We assume the overwhelming majority of names don't need to be escaped.
179- // But if they do, we have to fallback to the slow path.
180- return Qfalse ;
181- }
182-
183171 VALUE rsymbol = build_symbol (str , length );
184172
185173 if (cache -> length < JSON_RVALUE_CACHE_CAPA ) {
@@ -652,19 +640,6 @@ static VALUE json_string_unescape(JSON_ParserState *state, const char *string, c
652640 int unescape_len ;
653641 char buf [4 ];
654642
655- if (is_name && state -> in_array ) {
656- VALUE cached_key ;
657- if (RB_UNLIKELY (symbolize )) {
658- cached_key = rsymbol_cache_fetch (& state -> name_cache , string , bufferSize );
659- } else {
660- cached_key = rstring_cache_fetch (& state -> name_cache , string , bufferSize );
661- }
662-
663- if (RB_LIKELY (cached_key )) {
664- return cached_key ;
665- }
666- }
667-
668643 VALUE result = rb_str_buf_new (bufferSize );
669644 rb_enc_associate_index (result , utf8_encindex );
670645 buffer = RSTRING_PTR (result );
0 commit comments