Skip to content

Commit 3557a5f

Browse files
committed
* benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
be self-contained and avoid dependencies, especially such small one. See ruby#393 (comment). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 011bd85 commit 3557a5f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sun Sep 22 19:00:28 2013 Benoit Daloze <[email protected]>
2+
3+
* benchmark/bm_app_answer.rb: revert r42990, benchmark scripts should
4+
be self-contained and avoid dependencies, especially such small one.
5+
See https://github.com/ruby/ruby/pull/393#issuecomment-24861301.
6+
17
Sat Sep 21 20:11:06 2013 Nobuyoshi Nakada <[email protected]>
28

39
* process.c (rb_fork_internal): remove cloexec setting on pipes

benchmark/bm_app_answer.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
require_relative 'other-lang/ack'
1+
def ack(m, n)
2+
if m == 0 then
3+
n + 1
4+
elsif n == 0 then
5+
ack(m - 1, 1)
6+
else
7+
ack(m - 1, ack(m, n - 1))
8+
end
9+
end
210

311
def the_answer_to_life_the_universe_and_everything
412
(ack(3,7).to_s.split(//).inject(0){|s,x| s+x.to_i}.to_s + "2" ).to_i

0 commit comments

Comments
 (0)