Speed up FullStepRow index comparison by leveraging big-endian byte layout

This commit is contained in:
Jack Grigg
2016-06-09 18:02:29 +12:00
parent 1dd8ce9ba5
commit d07cf62991
2 changed files with 5 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ public:
FullStepRow(const FullStepRow<W>& a, const FullStepRow<W>& b, size_t len, size_t lenIndices, int trim);
FullStepRow& operator=(const FullStepRow<WIDTH>& a);
inline bool IndicesBefore(const FullStepRow<WIDTH>& a, size_t len) const { return ArrayToEhIndex(hash+len) < ArrayToEhIndex(a.hash+len); }
inline bool IndicesBefore(const FullStepRow<WIDTH>& a, size_t len, size_t lenIndices) const { return memcmp(hash+len, a.hash+len, lenIndices) < 0; }
std::vector<eh_index> GetIndices(size_t len, size_t lenIndices) const;
template<size_t W>