@@ -663,47 +663,36 @@ namespace UF
663663 }
664664
665665 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
666- void MarkChanged (DynamicUpdateField<T, BlockBit, Bit>(Derived::* field), uint32 index )
666+ void MarkChanged (DynamicUpdateField<T, BlockBit, Bit>(Derived::*) )
667667 {
668668 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
669669
670670 if constexpr (BlockBit >= 0 )
671671 _changesMask.Set (BlockBit);
672672
673673 _changesMask.Set (Bit);
674- DynamicUpdateField<T, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
675- if (index < uf.size ())
676- uf.MarkChanged (index);
677674 }
678675
679676 template <typename Derived, typename K, typename V, int32 BlockBit, uint32 Bit>
680- void MarkChanged (MapUpdateField<K, V, BlockBit, Bit>(Derived::* field), std::type_identity_t<K> const & key )
677+ void MarkChanged (MapUpdateField<K, V, BlockBit, Bit>(Derived::*) )
681678 {
682679 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
683680
684681 if constexpr (BlockBit >= 0 )
685682 _changesMask.Set (BlockBit);
686683
687684 _changesMask.Set (Bit);
688- MapUpdateField<K, V, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
689- auto itr = uf._values .find (key);
690- if (itr != uf._values .end () && itr->second .state == MapUpdateFieldState::Unchanged)
691- itr->second .state = MapUpdateFieldState::Changed;
692685 }
693686
694687 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
695- void MarkChanged (SetUpdateField<T, BlockBit, Bit>(Derived::* field), std::type_identity_t<T> const & key )
688+ void MarkChanged (SetUpdateField<T, BlockBit, Bit>(Derived::*) )
696689 {
697690 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
698691
699692 if constexpr (BlockBit >= 0 )
700693 _changesMask.Set (BlockBit);
701694
702695 _changesMask.Set (Bit);
703- SetUpdateField<T, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
704- auto itr = uf._values .find (key);
705- if (itr != uf._values .end () && itr->second == MapUpdateFieldState::Unchanged)
706- itr->second = MapUpdateFieldState::Changed;
707696 }
708697
709698 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
@@ -751,35 +740,27 @@ namespace UF
751740 }
752741
753742 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
754- void ClearChanged (DynamicUpdateField<T, BlockBit, Bit>(Derived::* field), uint32 index )
743+ void ClearChanged (DynamicUpdateField<T, BlockBit, Bit>(Derived::*) )
755744 {
756745 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
757746
758- DynamicUpdateField<T, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
759- if (index < uf.size ())
760- uf.ClearChanged (index);
747+ _changesMask.Reset (Bit);
761748 }
762749
763750 template <typename Derived, typename K, typename V, int32 BlockBit, uint32 Bit>
764- void ClearChanged (MapUpdateField<K, V, BlockBit, Bit>(Derived::* field), std::type_identity_t<K> const & key )
751+ void ClearChanged (MapUpdateField<K, V, BlockBit, Bit>(Derived::*) )
765752 {
766753 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
767754
768- MapUpdateField<K, V, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
769- auto itr = uf._values .find (key);
770- if (itr != uf._values .end () && itr->second .state == MapUpdateFieldState::Changed)
771- itr->second .state = MapUpdateFieldState::Unchanged;
755+ _changesMask.Reset (Bit);
772756 }
773757
774758 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
775- void ClearChanged (SetUpdateField<T, BlockBit, Bit>(Derived::* field), std::type_identity_t<T> const & key )
759+ void ClearChanged (SetUpdateField<T, BlockBit, Bit>(Derived::*) )
776760 {
777761 static_assert (std::is_base_of_v<Base, Derived>, " Given field argument must belong to the same structure as this HasChangesMask" );
778762
779- SetUpdateField<T, BlockBit, Bit>& uf = (static_cast <Derived*>(this )->*field);
780- auto itr = uf._values .find (key);
781- if (itr != uf._values .end () && itr->second == MapUpdateFieldState::Changed)
782- itr->second = MapUpdateFieldState::Unchanged;
763+ _changesMask.Reset (Bit);
783764 }
784765
785766 template <typename Derived, typename T, int32 BlockBit, uint32 Bit>
0 commit comments