From 2307436b76cc99154ba54fbe00022b7b0c2bce8e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 3 Sep 2022 10:40:17 -0400 Subject: [PATCH] improve flow of control and remove redundant checks --- src/atom_vec.cpp | 4 +--- src/input.cpp | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index e1eac93990..b254575d88 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -1823,9 +1823,7 @@ void AtomVec::write_data(FILE *fp, int n, double **buf) if (atom->types_style == Atom::LABELS && atom->peratom[mdata_atom.index[nn]].name == "type") { fmt::print(fp," {}",atom->lmap->typelabel[ubuf(buf[i][j++]).i-1]); - continue; - } - fmt::print(fp, " {}", ubuf(buf[i][j++]).i); + } else fmt::print(fp, " {}", ubuf(buf[i][j++]).i); } else { for (m = 0; m < cols; m++) fmt::print(fp, " {}", ubuf(buf[i][j++]).i); } diff --git a/src/input.cpp b/src/input.cpp index b7fdc5b39c..f5ad023513 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1626,10 +1626,7 @@ void Input::kspace_style() void Input::labelmap() { - if (narg < 2 || (narg % 2 == 0)) error->all(FLERR,"Illegal labelmap command"); - if (domain->box_exist == 0) - error->all(FLERR,"Labelmap command before simulation box is defined"); - + if (domain->box_exist == 0) error->all(FLERR,"Labelmap command before simulation box is defined"); if (!atom->labelmapflag) atom->add_label_map(); atom->lmap->modify_lmap(narg,arg); }