@@ -1465,19 +1465,8 @@ static inline VALUE build_string(const char *start, const char *end, bool intern
1465
1465
# else
1466
1466
result = rb_utf8_str_new (start , (long )(end - start ));
1467
1467
if (intern ) {
1468
- # if STR_UMINUS_DEDUPE_FROZEN
1469
- // Starting from MRI 3.0 it is preferable to freeze the string
1470
- // before deduplication so that it can be interned directly
1471
- // otherwise it would be duplicated first which is wasteful.
1472
- result = rb_funcall (rb_str_freeze (result ), i_uminus , 0 );
1473
- # elif STR_UMINUS_DEDUPE
1474
- // MRI 2.5 and older do not deduplicate strings that are already
1475
- // frozen.
1476
- result = rb_funcall (result , i_uminus , 0 );
1477
- # else
1478
- result = rb_str_freeze (result );
1479
- # endif
1480
- }
1468
+ result = rb_funcall (rb_str_freeze (result ), i_uminus , 0 );
1469
+ }
1481
1470
# endif
1482
1471
1483
1472
if (symbolize ) {
@@ -1613,15 +1602,15 @@ static VALUE json_string_unescape(char *string, char *stringEnd, bool intern, bo
1613
1602
}
1614
1603
1615
1604
1616
- #line 1617 "parser.c"
1605
+ #line 1606 "parser.c"
1617
1606
enum {JSON_string_start = 1 };
1618
1607
enum {JSON_string_first_final = 8 };
1619
1608
enum {JSON_string_error = 0 };
1620
1609
1621
1610
enum {JSON_string_en_main = 1 };
1622
1611
1623
1612
1624
- #line 645 "parser.rl"
1613
+ #line 634 "parser.rl"
1625
1614
1626
1615
1627
1616
static int
@@ -1642,15 +1631,15 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
1642
1631
VALUE match_string ;
1643
1632
1644
1633
1645
- #line 1646 "parser.c"
1634
+ #line 1635 "parser.c"
1646
1635
{
1647
1636
cs = JSON_string_start ;
1648
1637
}
1649
1638
1650
- #line 665 "parser.rl"
1639
+ #line 654 "parser.rl"
1651
1640
json -> memo = p ;
1652
1641
1653
- #line 1654 "parser.c"
1642
+ #line 1643 "parser.c"
1654
1643
{
1655
1644
if ( p == pe )
1656
1645
goto _test_eof ;
@@ -1675,7 +1664,7 @@ case 2:
1675
1664
goto st0 ;
1676
1665
goto st2 ;
1677
1666
tr2 :
1678
- #line 632 "parser.rl"
1667
+ #line 621 "parser.rl"
1679
1668
{
1680
1669
* result = json_string_unescape (json -> memo + 1 , p , json -> parsing_name || json -> freeze , json -> parsing_name && json -> symbolize_names );
1681
1670
if (NIL_P (* result )) {
@@ -1685,14 +1674,14 @@ case 2:
1685
1674
{p = (( p + 1 ))- 1 ;}
1686
1675
}
1687
1676
}
1688
- #line 642 "parser.rl"
1677
+ #line 631 "parser.rl"
1689
1678
{ p -- ; {p ++ ; cs = 8 ; goto _out ;} }
1690
1679
goto st8 ;
1691
1680
st8 :
1692
1681
if ( ++ p == pe )
1693
1682
goto _test_eof8 ;
1694
1683
case 8 :
1695
- #line 1696 "parser.c"
1684
+ #line 1685 "parser.c"
1696
1685
goto st0 ;
1697
1686
st3 :
1698
1687
if ( ++ p == pe )
@@ -1768,7 +1757,7 @@ case 7:
1768
1757
_out : {}
1769
1758
}
1770
1759
1771
- #line 667 "parser.rl"
1760
+ #line 656 "parser.rl"
1772
1761
1773
1762
if (json -> create_additions && RTEST (match_string = json -> match_string )) {
1774
1763
VALUE klass ;
@@ -1965,15 +1954,15 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
1965
1954
}
1966
1955
1967
1956
1968
- #line 1969 "parser.c"
1957
+ #line 1958 "parser.c"
1969
1958
enum {JSON_start = 1 };
1970
1959
enum {JSON_first_final = 10 };
1971
1960
enum {JSON_error = 0 };
1972
1961
1973
1962
enum {JSON_en_main = 1 };
1974
1963
1975
1964
1976
- #line 877 "parser.rl"
1965
+ #line 866 "parser.rl"
1977
1966
1978
1967
1979
1968
/*
@@ -1991,16 +1980,16 @@ static VALUE cParser_parse(VALUE self)
1991
1980
GET_PARSER ;
1992
1981
1993
1982
1994
- #line 1995 "parser.c"
1983
+ #line 1984 "parser.c"
1995
1984
{
1996
1985
cs = JSON_start ;
1997
1986
}
1998
1987
1999
- #line 894 "parser.rl"
1988
+ #line 883 "parser.rl"
2000
1989
p = json -> source ;
2001
1990
pe = p + json -> len ;
2002
1991
2003
- #line 2004 "parser.c"
1992
+ #line 1993 "parser.c"
2004
1993
{
2005
1994
if ( p == pe )
2006
1995
goto _test_eof ;
@@ -2034,7 +2023,7 @@ case 1:
2034
2023
cs = 0 ;
2035
2024
goto _out ;
2036
2025
tr2 :
2037
- #line 869 "parser.rl"
2026
+ #line 858 "parser.rl"
2038
2027
{
2039
2028
char * np = JSON_parse_value (json , p , pe , & result , 0 );
2040
2029
if (np == NULL ) { p -- ; {p ++ ; cs = 10 ; goto _out ;} } else {p = (( np ))- 1 ;}
@@ -2044,7 +2033,7 @@ cs = 0;
2044
2033
if ( ++ p == pe )
2045
2034
goto _test_eof10 ;
2046
2035
case 10 :
2047
- #line 2048 "parser.c"
2036
+ #line 2037 "parser.c"
2048
2037
switch ( (* p ) ) {
2049
2038
case 13 : goto st10 ;
2050
2039
case 32 : goto st10 ;
@@ -2133,7 +2122,7 @@ case 9:
2133
2122
_out : {}
2134
2123
}
2135
2124
2136
- #line 897 "parser.rl"
2125
+ #line 886 "parser.rl"
2137
2126
2138
2127
if (cs >= JSON_first_final && p == pe ) {
2139
2128
return result ;
0 commit comments