I am using protobuf for my program(C++). Currently, I have to check the difference between two proto messages, for which I am exploring the MessageDifferencer tool.
For setting the RepeatedFieldComparison parameter, I am not able to fully grasp the contrast between the AS_SET and AS_SMART_SET options?
I went through the documentation, it is mentioned that AS_SMART_SET is Similar to AS_SET, but match elements with fewest diffs., however not able to find any detailed information.
Any suggestion in the right direction will do.
A bit of code to get the context:
using google::protobuf::util::MessageDifferencer;
MessageDifferencer differencer;
std::string report;
differencer.ReportDifferencesToString(&report);
differencer.set_float_comparison(MessageDifferencer::FloatComparison::APPROXIMATE);
differencer.set_repeated_field_comparison(MessageDifferencer::RepeatedFieldComparison::AS_SET/AS_SMART_SET);
I am talking about configuring the set_repeated_field_comparison() of the Messagedifferencer.