Add DCHECK to verify arenas are the same in `ExtensionSet::InternalSwap`.
This makes it clearer that `InternalSwap` is only called on `ExtensionSet` instances allocated on the same arena.
PiperOrigin-RevId: 808268211
diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc
index 3f3959a..1bc8599 100644
--- a/src/google/protobuf/extension_set.cc
+++ b/src/google/protobuf/extension_set.cc
@@ -1025,7 +1025,7 @@
void ExtensionSet::InternalSwap(ExtensionSet* other) {
using std::swap;
- swap(arena_, other->arena_);
+ ABSL_DCHECK_EQ(arena_, other->arena_);
swap(flat_capacity_, other->flat_capacity_);
swap(flat_size_, other->flat_size_);
swap(map_, other->map_);