Commit 873b29e
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 5abd434 commit 873b29e
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
1479 | | - | |
| 1479 | + | |
| 1480 | + | |
1480 | 1481 | | |
1481 | 1482 | | |
1482 | 1483 | | |
| |||
1485 | 1486 | | |
1486 | 1487 | | |
1487 | 1488 | | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
1488 | 1497 | | |
1489 | 1498 | | |
1490 | 1499 | | |
| |||
1503 | 1512 | | |
1504 | 1513 | | |
1505 | 1514 | | |
1506 | | - | |
| 1515 | + | |
1507 | 1516 | | |
1508 | 1517 | | |
1509 | 1518 | | |
| |||
0 commit comments