Use cylinder use helper function

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-11-17 13:52:22 +00:00
parent 74582de06c
commit 1739042f34
2 changed files with 4 additions and 14 deletions

View file

@ -264,12 +264,8 @@ static void parse_cylinder_keyvalue(void *_cylinder, const char *key, const char
return;
}
if (!strcmp(key, "use")) {
for (enum cylinderuse i = 0; i < NUM_GAS_USE; i++) {
if (same_string(value, cylinderuse_text[i])) {
cylinder->cylinder_use = i;
return;
}
}
cylinder->cylinder_use = cylinderuse_from_text(value);
return;
}
report_error("Unknown cylinder key/value pair (%s/%s)", key, value);
}