lib/openstudio/extension.rb in openstudio-extension-0.4.2 vs lib/openstudio/extension.rb in openstudio-extension-0.4.3
- old
+ new
@@ -207,15 +207,13 @@
#
# @return [Hash] Output OSW with measure argument set to argument value
def self.set_measure_argument(osw, measure_dir_name, argument_name, argument_value, step_name = nil)
result = false
osw[:steps].each do |step|
- if step[:measure_dir_name] == measure_dir_name
- if step_name.nil? || step[:name] == step_name
- step[:arguments][argument_name.to_sym] = argument_value
- result = true
- end
+ if step[:measure_dir_name] == measure_dir_name && (step_name.nil? || step[:name] == step_name)
+ step[:arguments][argument_name.to_sym] = argument_value
+ result = true
end
end
if !result
if step_name
@@ -237,13 +235,11 @@
#
# @return [Boolean] true or false
def self.measure_in_osw(osw, measure_dir_name, step_name = nil)
result = false
osw[:steps].each do |step|
- if step[:measure_dir_name] == measure_dir_name
- if step_name.nil? || step[:name] == step_name
- result = true
- end
+ if step[:measure_dir_name] == measure_dir_name && (step_name.nil? || step[:name] == step_name)
+ result = true
end
end
return result
end