diff --git a/src/qinterface/qinterface.cpp b/src/qinterface/qinterface.cpp index ed3724b6c..8f232e43a 100644 --- a/src/qinterface/qinterface.cpp +++ b/src/qinterface/qinterface.cpp @@ -858,12 +858,7 @@ std::map QInterface::MultiShotMeasureMask( } } - auto result = results.find(dist); - if (result == results.end()) { - results[dist] = 1; - } else { - result->second++; - } + results[dist]++; } return results; diff --git a/src/qunit.cpp b/src/qunit.cpp index ac88a542a..832a4dc11 100644 --- a/src/qunit.cpp +++ b/src/qunit.cpp @@ -1319,12 +1319,7 @@ real1_f QUnit::ProbParity(const bitCapInt& mask) RevertBasis1Qb(qIndices[i]); - auto unit = units.find(shard.unit); - if (unit == units.end()) { - units[shard.unit] = pow2(shard.mapped); - } else { - unit->second |= pow2(shard.mapped); - } + units[shard.unit] |= pow2(shard.mapped); } if (qIndices.size() == 0) {