[style] proper place for operator==
@@ -32,6 +32,24 @@ namespace NCB {
Groups = std::move(groups);
}
+ bool operator==(const TObjectsGrouping& rhs) const {
+ if (IsTrivial()) {
+ if (rhs.IsTrivial()) {
+ return GroupCount == rhs.GroupCount;
+ }
+ return (GroupCount == rhs.GroupCount) &&
+ !FindIfPtr(
+ rhs.Groups,
+ [](TGroupBounds groupBounds) {
+ return groupBounds.GetSize() != 1;
+ }
+ );
+ }
+ return Groups == rhs.Groups;
+ }
+
+ SAVELOAD()
+
ui32 GetObjectCount() const {
return IsTrivial() ? GroupCount : Groups.back().End;
}
@@ -64,22 +82,6 @@ namespace NCB {
return Groups;
}
- bool operator==(const TObjectsGrouping& rhs) const {
- if (IsTrivial()) {
- if (rhs.IsTrivial()) {
- return GroupCount == rhs.GroupCount;
- }
- return (GroupCount == rhs.GroupCount) &&
- !FindIfPtr(
- rhs.Groups,
- [](TGroupBounds groupBounds) {
- return groupBounds.GetSize() != 1;
- }
- );
- }
- return Groups == rhs.Groups;
- }
-
ui32 GetGroupIdxForObject(ui32 objectIdx) const {
CB_ENSURE(
objectIdx < GetObjectCount(),
