bool equal()

in hessian2/object.hpp [691:712]


  bool equal(const Object& o) const override {
    if (o.type() != type()) {
      return false;
    }

    ABSL_ASSERT(o.toUntypedMap().has_value());
    auto& o_data = o.toUntypedMap().value().get();
    if (data_.size() != o_data.size()) {
      return false;
    }

    for (const auto& elem : data_) {
      auto it = o_data.find(elem.first);
      if (it == o_data.end()) {
        return false;
      }
      if (*(it->second) != *(elem.second)) {
        return false;
      }
    }
    return true;
  }