| 914 | |
| 915 | template <bool ignoreNullKeys> |
| 916 | bool HashTable<ignoreNullKeys>::hashRows( |
| 917 | folly::Range<char**> rows, |
| 918 | bool initNormalizedKeys, |
| 919 | raw_vector<uint64_t>& hashes) { |
| 920 | if (rows.empty()) { |
| 921 | return true; |
| 922 | } |
| 923 | if (!initNormalizedKeys && hashMode_ == HashMode::kNormalizedKey) { |
| 924 | for (auto i = 0; i < rows.size(); ++i) { |
| 925 | hashes[i] = |
| 926 | mixNormalizedKey(RowContainer::normalizedKey(rows[i]), sizeBits_); |
| 927 | } |
| 928 | return true; |
| 929 | } |
| 930 | |
| 931 | for (int32_t i = 0; i < hashers_.size(); ++i) { |
| 932 | auto& hasher = hashers_[i]; |
| 933 | if (hashMode_ == HashMode::kHash) { |
| 934 | rows_->hash(i, rows, i > 0, hashes.data()); |
| 935 | } else { |
| 936 | // Array or normalized key. |
| 937 | auto column = rows_->columnAt(i); |
| 938 | if (!hasher->computeValueIdsForRows( |
| 939 | rows.data(), |
| 940 | rows.size(), |
| 941 | column.offset(), |
| 942 | column.nullByte(), |
| 943 | ignoreNullKeys ? 0 : column.nullMask(), |
| 944 | hashes)) { |
| 945 | // Must reconsider 'hashMode_' and start over. |
| 946 | return false; |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | if (hashMode_ == HashMode::kNormalizedKey && initNormalizedKeys) { |
| 951 | for (auto i = 0; i < rows.size(); ++i) { |
| 952 | RowContainer::normalizedKey(rows[i]) = hashes[i]; |
| 953 | hashes[i] = mixNormalizedKey(hashes[i], sizeBits_); |
| 954 | } |
| 955 | } |
| 956 | return true; |
| 957 | } |
| 958 | |
| 959 | namespace { |
| 960 | template <typename Source> |
nothing calls this directly
no test coverage detected