correct way to test if a value is in the AA

This commit is contained in:
skilion 2015-09-24 19:12:19 +02:00
parent 3489827431
commit 7afae8fbb8

View file

@ -18,10 +18,10 @@ struct Config
string get(string key)
{
import core.exception;
try {
return values[key];
} catch (RangeError e) {
auto p = key in values;
if (p) {
return *p;
} else {
throw new Exception("Missing config value: " ~ key);
}
}