Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite backend spring cleaning #2978

Merged
merged 6 commits into from
Mar 18, 2024

Conversation

pmatilai
Copy link
Member

This one is a particularly bad case of int/enum abuse. Not so suprisingly, using separate variables for sqlite and rpm side returns makes the stuff much saner. I can kinda remember this even: "Just make it work now, I'll clean it all up later" and this is payback time.

Use a separate local int for sqlite-side returns.
We're only interested in SQLITE_ROW returns in here, don't bother
storing the return code which lets us use rpmRC as per the real
return code of the function.
Use a separate local int for sqlite-side returns. Unsurprisingly
the code looks saner too as a result: the earlier calls already
set rc accordingly, and rc can only be SQLITE_DONE in the case it ran
through the sqlite_step() loop, in which case we better check for
in that local scope.
Similar to previous: mixing up rpmRC and sqlite codes is a bad idea
and makes the code confusing at best.
@pmatilai pmatilai merged commit d1ecb66 into rpm-software-management:master Mar 18, 2024
1 check passed
@pmatilai pmatilai deleted the typeclean2 branch March 18, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant