Repository navigation
Commit 5654448
committed
Use shallow copies instead of deepcopy in Learner2D.__getstate__
Key-level mutations (stack pops/inserts) are all that restore() needs to
roll back; values are never mutated in place. A deepcopy of the full
data dict would add O(npoints) allocation to every
ask(tell_pending=False) call and to pickling.1 parent 0c8774a commit 5654448
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
900 | | - | |
901 | | - | |
| 900 | + | |
| 901 | + | |
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
| |||
0 commit comments