ruby-changes:70025
From: ima1zumi <ko1@a...>
Date: Fri, 3 Dec 2021 00:39:43 +0900 (JST)
Subject: [ruby-changes:70025] 4d4716d939 (master): [ruby/reline] No need to check `x > 0`
https://git.ruby-lang.org/ruby.git/commit/?id=4d4716d939 From 4d4716d939ad8cb288a503e97c73ed8cfbc12348 Mon Sep 17 00:00:00 2001 From: ima1zumi <mariimaizumi5@g...> Date: Wed, 17 Nov 2021 23:10:45 +0900 Subject: [ruby/reline] No need to check `x > 0` Checked in the previous line. https://github.com/ruby/reline/commit/bf774c0f2c --- lib/reline/ansi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 3a4ac42050f..c5648732419 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -277,7 +277,7 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L277 def self.move_cursor_up(x) if x > 0 - @@output.write "\e[#{x}A" if x > 0 + @@output.write "\e[#{x}A" elsif x < 0 move_cursor_down(-x) end @@ -285,7 +285,7 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L285 def self.move_cursor_down(x) if x > 0 - @@output.write "\e[#{x}B" if x > 0 + @@output.write "\e[#{x}B" elsif x < 0 move_cursor_up(-x) end -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/