Use initNode for safe, effective relief from code bloat.
This commit is contained in:
parent
9130605ca7
commit
dfc22cf009
1 changed files with 1 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue