MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / combineHash

Function combineHash

native/Base.h:111–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 /// \return The final hash code
110 template<typename T>
111 uintptr_t combineHash(const std::vector<std::shared_ptr<T> > &vector, bool withOrder) {
112 size_t count = vector.size();
113 uintptr_t combinedHashcode = 0x1;
114 for (size_t i = 0; i < count; i++) {
115 auto hashNode = std::dynamic_pointer_cast<HashNode>(vector.at(i));
116 if (hashNode != nullptr) {
117 combinedHashcode ^= (hashNode->hash());
118 if (withOrder)
119 combinedHashcode ^= (127U * (i << 6));
120 }
121 }
122 return combinedHashcode;
123 }
124
125 /// Compute the hash code according to the given vector, and embed order index as well when possible.
126 /// \tparam Iter The class type for hashing

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected