plivesey / RocketData

A caching and consistency solution for immutable models.
https://plivesey.github.io/RocketData
Apache License 2.0
648 stars 50 forks source link

block unnecessary work to improve performance #82

Closed elijahdou closed 6 years ago

elijahdou commented 6 years ago

In this pr, i do 2 things. The first one, I adapte the swift4 syntax to eliminate the warnings. The second one is performance improvement. Performance improvement as follow, when called dataHolder.setData(data, changeTime: ChangeTime()) method, if method return directly because of the conflict resolution mechanism,and code logic will continue to write data to the cache. In this case, it is unnecessary.