using .empty() on stl containers

This commit is contained in:
Erik Frojdh
2020-06-29 17:20:56 +02:00
parent 05ef55b258
commit 19e40cf0e6
6 changed files with 33 additions and 33 deletions

View File

@@ -407,7 +407,7 @@ TEST_CASE("threshold", "[.cmd][.new]") {
auto prev_threshold = det.getThresholdEnergy();
auto prev_energies =
det.getTrimEnergies().tsquash("inconsistent trim energies to test");
if (prev_energies.size() != 0) {
if (!prev_energies.empty()) {
std::ostringstream oss1, oss2;
proxy.Call("threshold", {"4500", "standard"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "threshold [4500, standard]\n");
@@ -436,7 +436,7 @@ TEST_CASE("thresholdnotb", "[.cmd][.new]") {
auto prev_threshold = det.getThresholdEnergy();
auto prev_energies =
det.getTrimEnergies().tsquash("inconsistent trim energies to test");
if (prev_energies.size() != 0) {
if (!prev_energies.empty()) {
std::ostringstream oss1, oss2;
proxy.Call("thresholdnotb", {"4500 standard"}, -1, PUT, oss1);
REQUIRE(oss1.str() == "thresholdnotb [4500 standard]\n");