improve flow of control and remove redundant checks

This commit is contained in:
Axel Kohlmeyer
2022-09-03 10:40:17 -04:00
parent 2eca1eecdc
commit 2307436b76
2 changed files with 2 additions and 7 deletions

View File

@ -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);
}

View File

@ -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);
}