[前][次][番号順一覧][スレッド一覧]

ruby-changes:62008

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 29 Jun 2020 11:07:18 +0900 (JST)
Subject: [ruby-changes:62008] b5adaa8dbd (master): goruby_options: do not goto into a branch

https://git.ruby-lang.org/ruby.git/commit/?id=b5adaa8dbd

From b5adaa8dbdd6ce929faf9e22badbf520e9b0850b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Mon, 15 Jun 2020 14:52:02 +0900
Subject: goruby_options: do not goto into a branch

I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea.  Better refactor.

diff --git a/goruby.c b/goruby.c
index ddb6256..e4119c5 100644
--- a/goruby.c
+++ b/goruby.c
@@ -49,10 +49,8 @@ goruby_options(int argc, char **argv) https://github.com/ruby/ruby/blob/trunk/goruby.c#L49
 	close(infd);
 	return ret;
     }
-    else {
-      no_irb:
-	return ruby_options(argc, argv);
-    }
+  no_irb:
+    return ruby_options(argc, argv);
 }
 
 int
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]