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

ruby-changes:30911

From: zzak <ko1@a...>
Date: Fri, 20 Sep 2013 23:35:41 +0900 (JST)
Subject: [ruby-changes:30911] zzak:r42990 (trunk): * benchmark/bm_app_answer.rb: removed duplicate code [Fixes GH-393]

zzak	2013-09-20 23:35:32 +0900 (Fri, 20 Sep 2013)

  New Revision: 42990

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42990

  Log:
    * benchmark/bm_app_answer.rb: removed duplicate code [Fixes GH-393]
      https://github.com/ruby/ruby/pull/393

  Modified files:
    trunk/ChangeLog
    trunk/benchmark/bm_app_answer.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42989)
+++ ChangeLog	(revision 42990)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Sep 20 23:34:48 2013  Zachary Scott  <e@z...>
+
+	* benchmark/bm_app_answer.rb: removed duplicate code [Fixes GH-393]
+	  https://github.com/ruby/ruby/pull/393
+
 Fri Sep 20 23:24:08 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (btest, btest-ruby, test-knownbug): add $(RUN_OPTS) to
Index: benchmark/bm_app_answer.rb
===================================================================
--- benchmark/bm_app_answer.rb	(revision 42989)
+++ benchmark/bm_app_answer.rb	(revision 42990)
@@ -1,15 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/benchmark/bm_app_answer.rb#L1
-def ack(m, n)
-  if m == 0 then
-    n + 1
-  elsif n == 0 then
-    ack(m - 1, 1)
-  else
-    ack(m - 1, ack(m, n - 1))
-  end
-end
+require_relative 'other-lang/ack'
 
 def the_answer_to_life_the_universe_and_everything
   (ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i
 end
 
-answer = the_answer_to_life_the_universe_and_everything
+answer = the_answer_to_life_the_universe_and_everything
\ No newline at end of file

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

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