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

@ -87,7 +87,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) {
if (detectors.size() == 0)
if (detectors.empty())
throw sls::RuntimeError("No detectors added");
if (positions.empty() ||
(positions.size() == 1 && positions[0] == -1)) {
@ -115,7 +115,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) const {
if (detectors.size() == 0)
if (detectors.empty())
throw sls::RuntimeError("No detectors added");
if (positions.empty() ||
(positions.size() == 1 && positions[0] == -1)) {
@ -143,7 +143,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) {
if (detectors.size() == 0)
if (detectors.empty())
throw sls::RuntimeError("No detectors added");
if (positions.empty() ||
(positions.size() == 1 && positions[0] == -1)) {
@ -168,7 +168,7 @@ class DetectorImpl : public virtual slsDetectorDefs {
std::vector<int> positions,
typename NonDeduced<CT>::type... Args) const {
if (detectors.size() == 0)
if (detectors.empty())
throw sls::RuntimeError("No detectors added");
if (positions.empty() ||
(positions.size() == 1 && positions[0] == -1)) {