* bug#61165: 30.0.50; Avoid nreverse in row_to_value
@ 2023-01-30 7:30 Helmut Eller
2023-02-02 19:49 ` Eli Zaretskii
0 siblings, 1 reply; 2+ messages in thread
From: Helmut Eller @ 2023-01-30 7:30 UTC (permalink / raw)
To: 61165
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sqlite.patch --]
[-- Type: text/x-diff, Size: 525 bytes --]
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#61165: 30.0.50; Avoid nreverse in row_to_value
2023-01-30 7:30 bug#61165: 30.0.50; Avoid nreverse in row_to_value Helmut Eller
@ 2023-02-02 19:49 ` Eli Zaretskii
0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-02-02 19:49 UTC (permalink / raw)
To: Helmut Eller; +Cc: 61165-done
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-02 19:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 7:30 bug#61165: 30.0.50; Avoid nreverse in row_to_value Helmut Eller
2023-02-02 19:49 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.