thoughtbot / CombineViewModel

An implementation of the Model-View-ViewModel (MVVM) pattern using Combine.
MIT License
59 stars 4 forks source link

Avoid defer for clarity in UnfairAtomic.swap(_:) #12

Closed sharplet closed 4 years ago

sharplet commented 4 years ago

Instead of the slightly-fancy defer we were doing to return the old value, be more straightforward and move the old value out of memory before reinitialising it with the newValue.