1
0
Fork 0

Use initNode for safe, effective relief from code bloat.

This commit is contained in:
stuart 2009-02-12 21:14:54 +00:00
parent 9130605ca7
commit dfc22cf009

View file

@ -200,15 +200,7 @@ _setlistener("/sim/signals/fdm-initialized", func {
# Set up the MTBF/MCFB properties to 0. Note that they are in a separate
# subtree, as there's no guarantee that the property isn't a leaf.
var n = props.globals.getNode(failure_root ~ prop ~ t, 1);
if (n.getValue() == nil) {
n.setDoubleValue(0);
}
if (n.getType() == "UNSPECIFIED") {
n.setDoubleValue(n.getValue());
}
props.globals.initNode(failure_root ~ prop ~ t, 0);
if (o.failure == fail.SERVICEABLE) {
# If the property has a serviceable property, set it if appropriate.