[why] the original logic is too round
Signed-off-by: Hu XueJiao 1034502035@qq.com --- lib/job2sh.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 14bf7159..7f9cf562 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -287,9 +287,7 @@ class Job2sh < Job @setups = available_programs(:setup) @programs = available_programs(:workload_elements)
- if !job - job = (@jobx || @job).clone # a shallow copy so that delete_if won't impact @job - end + job ||= (@jobx || @job).clone # a shallow copy so that delete_if won't impact @job
@cur_func = :extract_stats
@@ -317,7 +315,7 @@ class Job2sh < Job @setups = available_programs(:setup) @programs = available_programs(:workload_elements)
- if !job + unless job job = (@jobx || @job).clone # a shallow copy so that delete_if won't impact @job job.delete_if { |key, val| parse_one([], key, val, :PASS_EXPORT_ENV) } end