On Fri, Nov 06, 2020 at 01:52:40PM +0800, Liu Shaofei wrote:
On Fri, Nov 06, 2020 at 11:07:36AM +0800, Xu Xijian wrote:
[why] Somewhere there is only one line of code in if block, simply them with format "$cmd if $condition"
Signed-off-by: Xu Xijian hdxuxijian@163.com
src/scheduler/jobfile_operate.cr | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index 68818ed..80cbcf7 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -57,9 +57,7 @@ module Jobfile::Operate
def self.parse_one(script_lines, key, val) if valid_shell_variable?(key)
if val.as_h?
return false
end
return false if val.as_h? value = if val.as_a? shell_escape(val.as_a)
@@ -133,9 +131,7 @@ module Jobfile::Operate end
please avoid multilayer nesting of "if", the early exit "if" condition. Thanks, Liushaofei
Good, but it's the matter of the context code, I'll fix it in another patch.
Thanks, Xijian