Skip to content

Commit

Permalink
fixed loop stopping one iteration too early
Browse files Browse the repository at this point in the history
  • Loading branch information
SJulianS committed Jul 1, 2024
1 parent a0dc036 commit 2011513
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/hawkeye/src/sbox_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ bool smallset_t::empty() const
for (int i = 0; i < 4; i++)
{
if (dw64[i])
{
return false;
}
}
return true;
}
Expand All @@ -94,7 +96,9 @@ u8 smallset_t::least_bit() const
for (int i = 0; i < 4; i++)
{
if (dw64[i])
{
return i * 64 + least_bit(dw64[i]);
}
}
std::cerr << "Called smallset_t::least_bit() on empty set\n" << std::endl;
return 0;
Expand Down Expand Up @@ -166,8 +170,10 @@ smallset_t smallset_t::shuffle(u8 shift) const

void smallset_t::to_array(u64* arr) const
{
for (int i=0; i<3; i++)
arr[i] = dw64[3-i];
for (int i = 0; i < 4; i++)
{
arr[i] = dw64[3 - i];
}
}

void smallset_t::set(u8 bit)
Expand Down

0 comments on commit 2011513

Please sign in to comment.