[Rpm-maint] [rpm-software-management/rpm] Various sqlite backend optimizations and cleanups (#972)

Panu Matilainen notifications at github.com
Tue Dec 10 11:19:38 UTC 2019


pmatilai commented on this pull request.



> @@ -584,11 +558,8 @@ static rpmRC sqlite_idxdbIter(dbiIndex dbi, dbiCursor dbc, const char *keyp, siz
 	    dbc->key = sqlite3_column_blob(dbc->stmt, 0);
 	}
 	dbc->keylen = sqlite3_column_bytes(dbc->stmt, 0);
-	if (set) {
-	    dbiCursor kc = dbiCursorInit(dbi, 0);
-	    rc = sqlite_idxdbByKey(dbi, kc, dbc->key, dbc->keylen, set);
-	    dbiCursorFree(dbi, kc);
-	}
+	if (set)
+	    rc = sqlite_idxdbByKey(dbi, dbc->subc, dbc->key, dbc->keylen, set);

The brace for single line items varies a lot throughout rpm, the only hard rule there is that anything spanning multiple lines in the source must use braces, even if the compiler thinks it's just one line.

I generally dislike unnecessary braces but sometimes they are introduced in anticipation for surrounding code, at other times they get left behind from other code changes, at other times they add to readability and at others, they're just ugly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/972#discussion_r355980467
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191210/5bef68dc/attachment.html>


More information about the Rpm-maint mailing list