ruby-changes:67305
From: aycabta <ko1@a...>
Date: Sun, 29 Aug 2021 20:30:43 +0900 (JST)
Subject: [ruby-changes:67305] 8e463e3e73 (master): [ruby/reline] Remove unnecessary condition
https://git.ruby-lang.org/ruby.git/commit/?id=8e463e3e73 From 8e463e3e73e37ff57a5fde142436280846718ecf Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Fri, 27 Aug 2021 01:50:49 +0900 Subject: [ruby/reline] Remove unnecessary condition https://github.com/ruby/reline/commit/07e911ec8e --- lib/reline.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/reline.rb b/lib/reline.rb index 91648bf..a3f37d1 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -189,12 +189,11 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L189 end pre, target, post= retrieve_completion_block(true) if target.nil? or target.empty? + return nil + end + result = call_completion_proc_with_checking_args(pre, target, post) + if result and result.size == 1 and result[0] == target result = nil - else - result = call_completion_proc_with_checking_args(pre, target, post) - if result and result.size == 1 and result[0] == target - result = nil - end end target_width = Reline::Unicode.calculate_width(target) x = cursor_pos.x - target_width -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/