Avoid datastore writes when no state has changed.