From dfc22cf0090a3951172cd206df2451293eea2b98 Mon Sep 17 00:00:00 2001 From: stuart Date: Thu, 12 Feb 2009 21:14:54 +0000 Subject: [PATCH] Use initNode for safe, effective relief from code bloat. --- Nasal/failures.nas | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Nasal/failures.nas b/Nasal/failures.nas index 1e758ba49..ccf6f7966 100644 --- a/Nasal/failures.nas +++ b/Nasal/failures.nas @@ -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.