simplify
This commit is contained in:
@ -4841,6 +4841,7 @@ set to an empty string, otherwise 1.
|
||||
*/
|
||||
int lammps_id_name(void *handle, const char *category, int idx, char *buffer, int buf_size) {
|
||||
auto lmp = (LAMMPS *) handle;
|
||||
if (idx < 0) return 0;
|
||||
|
||||
if (strcmp(category,"compute") == 0) {
|
||||
auto icompute = lmp->modify->get_compute_by_index(idx);
|
||||
@ -4849,8 +4850,9 @@ int lammps_id_name(void *handle, const char *category, int idx, char *buffer, in
|
||||
return 1;
|
||||
}
|
||||
} else if (strcmp(category,"dump") == 0) {
|
||||
if ((idx >=0) && (idx < lmp->output->ndump)) {
|
||||
strncpy(buffer, lmp->output->dump[idx]->id, buf_size);
|
||||
auto idump = lmp->output->get_dump_by_index(idx);
|
||||
if (idump) {
|
||||
strncpy(buffer, idump->id, buf_size);
|
||||
return 1;
|
||||
}
|
||||
} else if (strcmp(category,"fix") == 0) {
|
||||
|
||||
Reference in New Issue
Block a user