Skip to content

Commit

Permalink
Avoid size_t-to-unsigned conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec committed Aug 15, 2023
1 parent 89ccacf commit 88f6a72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tket/src/Transformations/SingleQubitSquash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "tket/Transformations/SingleQubitSquash.hpp"

#include <cstddef>
#include <numeric>

#include "Circuit/Command.hpp"
Expand Down Expand Up @@ -214,12 +215,12 @@ bool SingleQubitSquash::sub_is_better(
// the total size of the string representations.
return std::accumulate(
sub.begin(), sub.end(), 0,
[](unsigned a, const Command &cmd) {
[](std::size_t a, const Command &cmd) {
return a + cmd.get_op_ptr()->get_name().size();
}) <
std::accumulate(
chain.begin(), chain.end(), 0,
[](unsigned a, const Gate_ptr &gpr) {
[](std::size_t a, const Gate_ptr &gpr) {
return a + gpr->get_name().size();
});
}
Expand Down

0 comments on commit 88f6a72

Please sign in to comment.