1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #include "cmPathLabel.h"
7 cmPathLabel::cmPathLabel(std::string label)
8 : Label(std::move(label))
11 // Use a Jenkins one-at-a-time hash with under/over-flow protection
12 for (char i : this->Label) {
14 this->Hash += ((this->Hash & 0x003FFFFF) << 10);
15 this->Hash ^= ((this->Hash & 0xFFFFFFC0) >> 6);
17 this->Hash += ((this->Hash & 0x1FFFFFFF) << 3);
18 this->Hash ^= ((this->Hash & 0xFFFFF800) >> 11);
19 this->Hash += ((this->Hash & 0x0001FFFF) << 15);
22 bool cmPathLabel::operator<(const cmPathLabel& l) const
24 return this->Hash < l.Hash;
27 bool cmPathLabel::operator==(const cmPathLabel& l) const
29 return this->Hash == l.Hash;