diff --git a/day14/day14.cpp b/day14/day14.cpp index 60cf13e..d4a78d9 100644 --- a/day14/day14.cpp +++ b/day14/day14.cpp @@ -29,7 +29,7 @@ class InstructionBlock { long long maskValue(long long num) const { // We are dealing with a 36 bit numebr so we must use a long long to guarantee we can fit it long long res = num; - for (int i = 0; i < this->mask.size(); i++) { + for (std::string::size_type i = 0; i < this->mask.size(); i++) { char maskChar = this->mask.at(this->mask.size() - i - 1); if (maskChar == IGNORE_CHAR) { continue; @@ -84,10 +84,10 @@ class InstructionBlock { * @param startIdx The index to start the search at * @return std::vector All of the possible masked addresses */ - std::vector recursivelyMaskAddresses(long long address, int startIdx = 0) const { + std::vector recursivelyMaskAddresses(long long address, std::string::size_type startIdx = 0) const { std::vector results; long long res = address; - for (int i = startIdx; i < this->mask.size(); i++) { + for (std::string::size_type i = startIdx; i < this->mask.size(); i++) { char maskChar = this->mask.at(this->mask.size() - i - 1); if (maskChar == IGNORE_CHAR) { auto masked0 = this->setBitAt(res, i, '0');