emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61165: closed (30.0.50; Avoid nreverse in row_to_value)


From: GNU bug Tracking System
Subject: bug#61165: closed (30.0.50; Avoid nreverse in row_to_value)
Date: Thu, 02 Feb 2023 19:50:03 +0000

Your message dated Thu, 02 Feb 2023 21:49:35 +0200
with message-id <83cz6rx2y8.fsf@gnu.org>
and subject line Re: bug#61165: 30.0.50; Avoid nreverse in row_to_value
has caused the debbugs.gnu.org bug report #61165,
regarding 30.0.50; Avoid nreverse in row_to_value
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61165: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61165
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; Avoid nreverse in row_to_value Date: Mon, 30 Jan 2023 08:30:14 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
The function row_to_value in the file src/sqlite.c can avoid the call to
Fnreverse by traversing the row in reverse order.  Only a minor
improvement but the change is simple.

diff --git a/src/sqlite.c b/src/sqlite.c
index c96841e63f9..6e89ef04287 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -399,7 +399,7 @@ row_to_value (sqlite3_stmt *stmt)
   int len = sqlite3_column_count (stmt);
   Lisp_Object values = Qnil;
 
-  for (int i = 0; i < len; ++i)
+  for (int i = len - 1; 0 <= i; i--)
     {
       Lisp_Object v = Qnil;
 
@@ -434,7 +434,7 @@ row_to_value (sqlite3_stmt *stmt)
       values = Fcons (v, values);
     }
 
-  return Fnreverse (values);
+  return values;
 }
 
 static Lisp_Object

--- End Message ---
--- Begin Message --- Subject: Re: bug#61165: 30.0.50; Avoid nreverse in row_to_value Date: Thu, 02 Feb 2023 21:49:35 +0200
> From: Helmut Eller <eller.helmut@gmail.com>
> Date: Mon, 30 Jan 2023 08:30:14 +0100
> 
> The function row_to_value in the file src/sqlite.c can avoid the call to
> Fnreverse by traversing the row in reverse order.  Only a minor
> improvement but the change is simple.

Thanks, installed on the emacs-29 branch


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]