Skip to content

Commit

Permalink
Fix assignment method name
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanitoFatas committed Aug 7, 2015
1 parent 617406f commit 53894bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/general/assignment.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'benchmark/ips'

def slow
def fast
a, b, c, d, e, f, g, h = 1, 2, 3, 4, 5, 6, 7, 8
nil
end

def fast
def slow
a = 1
b = 2
c = 3
Expand All @@ -18,7 +18,7 @@ def fast
end

Benchmark.ips do |x|
x.report('Parallel Assignment') { slow }
x.report('Sequential Assignment') { fast }
x.report('Parallel Assignment') { fast }
x.report('Sequential Assignment') { slow }
x.compare!
end

0 comments on commit 53894bf

Please sign in to comment.