Changeset: 452faef04505 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/452faef04505
Modified Files:
        sql/storage/store.c
Branch: Sep2022
Log Message:

Avoid calling find_sql_schema(tr, "sys") twice in a function.
Inline find_sql_schema(tr, "sys") when the result is needed only at 1 place.


diffs (33 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4161,15 +4161,11 @@ static int
 sql_trans_drop_any_comment(sql_trans *tr, sqlid id)
 {
        sqlstore *store = tr->store;
-       sql_schema *sys;
+       sql_table *comments;
        sql_column *id_col;
-       sql_table *comments;
        oid row;
 
-       sys = find_sql_schema(tr, "sys");
-       assert(sys);
-
-       comments = find_sql_table(tr, sys, "comments");
+       comments = find_sql_table(tr, find_sql_schema(tr, "sys"), "comments");
        if (!comments) /* for example during upgrades */
                return 0;
 
@@ -4880,8 +4876,9 @@ sql_trans_create_func(sql_func **fres, s
                                          const char *mod, const char *impl, 
const char *query, bit varres, bit vararg, bit system, bit side_effect)
 {
        sqlstore *store = tr->store;
-       sql_table *sysfunc = find_sql_table(tr, find_sql_schema(tr, "sys"), 
"functions");
-       sql_table *sysarg = find_sql_table(tr, find_sql_schema(tr, "sys"), 
"args");
+       sql_schema *syss = find_sql_schema(tr, "sys");
+       sql_table *sysfunc = find_sql_table(tr, syss, "functions");
+       sql_table *sysarg = find_sql_table(tr, syss, "args");
        node *n;
        int number = 0, ftype = (int) type, flang = (int) lang, res = LOG_OK;
        bit semantics = TRUE;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to