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

ruby-changes:13198

From: marcandre <ko1@a...>
Date: Wed, 16 Sep 2009 16:18:52 +0900 (JST)
Subject: [ruby-changes:13198] Ruby:r24955 (ruby_1_8): * lib/matrix.rb: fix previous optimization

marcandre	2009-09-16 16:18:42 +0900 (Wed, 16 Sep 2009)

  New Revision: 24955

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

  Log:
    * lib/matrix.rb: fix previous optimization

  Modified files:
    branches/ruby_1_8/lib/matrix.rb

Index: ruby_1_8/lib/matrix.rb
===================================================================
--- ruby_1_8/lib/matrix.rb	(revision 24954)
+++ ruby_1_8/lib/matrix.rb	(revision 24955)
@@ -664,7 +664,7 @@
       if (akk = a[k][k]) == 0
         i = k
         begin
-          return 0 if (i += 1) > size
+          return 0 if (i += 1) >= size
         end while a[i][k] == 0
         a[i], a[k] = a[k], a[i]
         akk = a[k][k]
@@ -719,7 +719,7 @@
           i = k
           exists = true
           begin
-            if (i += 1) > a_row_size - 1
+            if (i += 1) >= a_row_size
               exists = false
               break
             end

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

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