This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch tdbc
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git


The following commit(s) were added to refs/heads/tdbc by this push:
     new 1cb0365  simplified internal management of TDBCResult, optimizing 
memory management, but method numows doesn't scale for large result sets
1cb0365 is described below

commit 1cb03658606c12dd6cd23f4d7647ea34ce7376e5
Author: Massimo Manghi <mxman...@apache.org>
AuthorDate: Fri May 17 12:24:30 2024 +0200

    simplified internal management of TDBCResult, optimizing memory management, 
but method numows doesn't scale for large result sets
---
 rivet/packages/dio/tdbc.tcl | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/rivet/packages/dio/tdbc.tcl b/rivet/packages/dio/tdbc.tcl
index 60a8b7d..9c2268d 100644
--- a/rivet/packages/dio/tdbc.tcl
+++ b/rivet/packages/dio/tdbc.tcl
@@ -121,8 +121,6 @@ namespace eval DIO {
         public variable     cached_rows
         public variable     columns
 
-        private variable    rownum
-
         constructor {args} { 
             eval configure  $args
             set cached_rows {}
@@ -148,7 +146,7 @@ namespace eval DIO {
                     return ""
                 }
             } else {
-                set row [lindex $cached_rows $rowid]
+                set cached_rows [lassign $cached_rows row]
             }
             incr rowid
             return $row
@@ -162,11 +160,9 @@ namespace eval DIO {
                 # from the whole set of results
 
                 if {[llength $cached_rows] == 0} {
-                    set rownum $rowid
                     set cached_rows [$resultid allrows -as lists 
-columnsvariable columns]
-                    set rowid 0
                 }
-                return [expr [llength $cached_rows] + $rownum]
+                return [expr [llength $cached_rows] + $rowid]
             } else {
                 return [$resultid rowcount]
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org
For additional commands, e-mail: commits-h...@tcl.apache.org

Reply via email to