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

ruby-changes:38524

From: marcandre <ko1@a...>
Date: Fri, 22 May 2015 22:38:30 +0900 (JST)
Subject: [ruby-changes:38524] marcandRe: r50605 (trunk): * lib/matrix.rb: Styling

marcandre	2015-05-22 22:37:02 +0900 (Fri, 22 May 2015)

  New Revision: 50605

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

  Log:
    * lib/matrix.rb: Styling

  Modified files:
    trunk/lib/prime.rb
Index: lib/prime.rb
===================================================================
--- lib/prime.rb	(revision 50604)
+++ lib/prime.rb	(revision 50605)
@@ -138,7 +138,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L138
   # +generator+:: optional. A pseudo-prime generator.
   def prime?(value, generator = Prime::Generator23.new)
     return false if value < 2
-    for num in generator
+    generator.each do |num|
       q,r = value.divmod num
       return true if q < num
       return false if r == 0
@@ -196,7 +196,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L196
     else
       pv = []
     end
-    for prime in generator
+    generator.each do |prime|
       count = 0
       while (value1, mod = value.divmod(prime)
              mod) == 0
@@ -211,7 +211,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L211
     if value > 1
       pv.push [value, 1]
     end
-    return pv
+    pv
   end
 
   # An abstract class for enumerating pseudo-prime numbers.
@@ -340,7 +340,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L340
         when 3; @prime = 5; @step = 2
         end
       end
-      return @prime
+      @prime
     end
     alias next succ
     def rewind
@@ -367,7 +367,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L367
 
     # Returns the cached prime numbers.
     def cache
-      return @primes
+      @primes
     end
     alias primes cache
     alias primes_so_far cache
@@ -392,7 +392,7 @@ class Prime https://github.com/ruby/ruby/blob/trunk/lib/prime.rb#L392
         @primes.push @next_to_check if @primes[2..@ulticheck_index].find {|prime| @next_to_check % prime == 0 }.nil?
         @next_to_check += 2
       end
-      return @primes[index]
+      @primes[index]
     end
   end
 

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

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