Commit 61f6830
committed
Don't write depth to JSON_Generator_State in some cases
For `JSON.generate` and `JSON::State#generate_new`, don't copy
generate_json_data::depth to JSON_Generator_State::depth.
In `JSON.generate`, the JSON_Generator_State is on the stack and
discarded anyway. In `JSON::State#generate_new`, we copy the struct to
avoid mutating the original one.1 parent 29d235d commit 61f6830
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
1477 | | - | |
| 1477 | + | |
| 1478 | + | |
1478 | 1479 | | |
1479 | 1480 | | |
1480 | 1481 | | |
| |||
1483 | 1484 | | |
1484 | 1485 | | |
1485 | 1486 | | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
1486 | 1495 | | |
1487 | 1496 | | |
1488 | 1497 | | |
| |||
1501 | 1510 | | |
1502 | 1511 | | |
1503 | 1512 | | |
1504 | | - | |
| 1513 | + | |
1505 | 1514 | | |
1506 | 1515 | | |
1507 | 1516 | | |
| |||
0 commit comments