Update of /cvsroot/ruby-dbi/src/lib/dbd_pg
In directory usw-pr-cvs1:/tmp/cvs-serv5872
Modified Files:
Pg.rb
Log Message:
cache calls to PGResult#result in class Tuples (by James F.Hranicky); which increases performance around factor 100.
Index: Pg.rb
===================================================================
RCS file: /cvsroot/ruby-dbi/src/lib/dbd_pg/Pg.rb,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Pg.rb 4 Jan 2002 11:53:09 -0000 1.17
+++ Pg.rb 17 Apr 2002 13:38:38 -0000 1.18
@@ -443,6 +443,7 @@
@db = db
@pg_result = pg_result
@index = -1
+ @result = @pg_result.result
@row = Array.new
end
@@ -452,8 +453,8 @@
def fetchrow
@index += 1
- if @index < @pg_result.result.size
- fill_array(@pg_result.result[@index])
+ if @index < @result.size
+ fill_array(@result[@index])
else
@row = nil
end
|