GNU bug report logs - #61165
30.0.50; Avoid nreverse in row_to_value

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 30 Jan 2023 07:31:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61165 in the body.
You can then email your comments to 61165 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61165; Package emacs. (Mon, 30 Jan 2023 07:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 30 Jan 2023 07:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Avoid nreverse in row_to_value
Date: Mon, 30 Jan 2023 08:30:14 +0100
[Message part 1 (text/plain, inline)]
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.

[sqlite.patch (text/x-diff, inline)]
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

Added tag(s) patch. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 30 Jan 2023 07:42:02 GMT) Full text and rfc822 format available.

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 02 Feb 2023 19:50:03 GMT) Full text and rfc822 format available.

Notification sent to Helmut Eller <eller.helmut <at> gmail.com>:
bug acknowledged by developer. (Thu, 02 Feb 2023 19:50:03 GMT) Full text and rfc822 format available.

Message #12 received at 61165-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 61165-done <at> debbugs.gnu.org
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 <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Mar 2023 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.