Skip to content

Commit

Permalink
Use prefix ++ with Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed Dec 20, 2023
1 parent 402c0c2 commit 5ca601a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fintamath/expressions/binary/PowExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ std::vector<Integer> PowExpression::getPartition(Integer bitNumber, const Intege

while (result.size() < variableCount) {
if (bitNumber % 2 == 1) {
counter++;
++counter;
}

if (bitNumber % 2 == 0) {
Expand Down
6 changes: 3 additions & 3 deletions src/fintamath/numbers/IntegerFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ std::map<Integer, Integer> factors(Integer rhs, Integer limit) {
std::map<Integer, Integer> factorRates;

while (rhs % 2 == 0) {
factorRates[2]++;
++factorRates[2];
rhs /= 2;
}

Expand All @@ -106,13 +106,13 @@ std::map<Integer, Integer> factors(Integer rhs, Integer limit) {

for (Integer i = 3; i <= limit; i += 2) {
while (rhs % i == 0) {
factorRates[i]++;
++factorRates[i];
rhs = rhs / i;
}
}

if (rhs > 1) {
factorRates[rhs]++;
++factorRates[rhs];
}

return factorRates;
Expand Down

0 comments on commit 5ca601a

Please sign in to comment.