[TensorRT] Add slightly faster hash computation for vector<int> (#5142)

* w

* w

Co-authored-by: modav <modav@microsoft.com>
This commit is contained in:
Moshe David 2020-09-14 19:01:59 +03:00 committed by GitHub
parent 0c7e9fb52a
commit 1d6a21fd08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ std::string GetEnginePath(const ::std::string& root, const std::string& name) {
std::string GetVecHash(const ::std::vector<int>& vec) {
std::size_t ret = vec.size();
for (auto& i : vec) {
for (auto i : vec) {
ret ^= i + 0x9e3779b9 + (ret << 6) + (ret >> 2);
}
return std::to_string(ret);