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

Rewrited usage of QSqlRecord. #48

Merged
merged 3 commits into from
Jul 17, 2013
Merged

Conversation

troyane
Copy link
Contributor

@troyane troyane commented Jul 17, 2013

Avoided multiple creation of QSqlRecord and pulled out record->indexOf's from cycles.

Avoided multiple creation of QSqlRecord (on calls query-
@@ -93,9 +93,10 @@ Cue* CueDAO::getCue(const int cueId) {
query.prepare("SELECT * FROM " CUE_TABLE " WHERE track_id = :id");
query.bindValue(":id", trackId);
if (query.exec()) {
const int idColumn = query.record().indexOf("id");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do this before the exec()? QSqlRecord copies all the values if you call query.record() after exec()'ing the query.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind! If the record() call comes before next() then it doesn't point to a valid row so there's no data to copy. It's fine as is.

@troyane
Copy link
Contributor Author

troyane commented Jul 17, 2013

@rryan take a look at new commit, please.

@rryan
Copy link
Member

rryan commented Jul 17, 2013

Looks good! Thank you @troyane

rryan added a commit that referenced this pull request Jul 17, 2013
Fix use of QSqlQuery::record() to reduce excessive copying of result rows. Fixes Bug #1201991.
@rryan rryan merged commit a4e75b4 into mixxxdj:master Jul 17, 2013
@daschuer daschuer mentioned this pull request Jun 11, 2018
11 tasks
ronso0 referenced this pull request in ronso0/mixxx Jan 20, 2020
merge master, adapt to LateNight redesign
daschuer pushed a commit that referenced this pull request Jul 8, 2020
Replace Master by Main in the Shade main mixing region
m0dB pushed a commit to m0dB/mixxx that referenced this pull request Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants