Hacker News new | ask | show | jobs
by bgwhn 2346 days ago
If the data structure has a reference count of one, you can safely mutate the data structure instead. Many persistent immutable data structure libraries use this as an additional optimization.