Skip to content

Commit

Permalink
Micro-optimize bitCapInt stream input
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Feb 15, 2025
1 parent 91e047f commit f92945c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ std::istream& operator>>(std::istream& is, bitCapInt& b)

// Start the output address value at 0.
b = ZERO_BCI;
for (size_t i = 0; i < input.size(); ++i) {
for (const char& i : input) {
// Left shift by 1 base-10 digit.
b = b * 10U;
// Add the next lowest base-10 digit.
bi_increment(&b, (input[i] - 48U));
bi_increment(&b, (i - 48U));
}

return is;
Expand Down

0 comments on commit f92945c

Please sign in to comment.