| 2789 | } |
| 2790 | |
| 2791 | static void AppendMetadataFingerprint(const KeyValueMetadata& metadata, |
| 2792 | std::stringstream* ss) { |
| 2793 | // Compute metadata fingerprint. KeyValueMetadata is not immutable, |
| 2794 | // so we don't cache the result on the metadata instance. |
| 2795 | const auto pairs = metadata.sorted_pairs(); |
| 2796 | if (!pairs.empty()) { |
| 2797 | *ss << "!{"; |
| 2798 | for (const auto& p : pairs) { |
| 2799 | const auto& k = p.first; |
| 2800 | const auto& v = p.second; |
| 2801 | // Since metadata strings can contain arbitrary characters, prefix with |
| 2802 | // string length to disambiguate. |
| 2803 | *ss << k.length() << ':' << k << ':'; |
| 2804 | *ss << v.length() << ':' << v << ';'; |
| 2805 | } |
| 2806 | *ss << '}'; |
| 2807 | } |
| 2808 | } |
| 2809 | |
| 2810 | std::string Field::ComputeFingerprint() const { |
| 2811 | const auto& type_fingerprint = type_->fingerprint(); |
no test coverage detected