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

Added 'const' or '&' to arguments when needed. #32

Merged
merged 4 commits into from
Jul 5, 2013

Conversation

troyane
Copy link
Contributor

@troyane troyane commented Jul 3, 2013

I was learning DAO's code. I found that it would be more simpler to understand code if there are const qualifiers for function arguments. Also, in this way we can avoid some errors and help compiler.

About references -- whenever we don't need object's copy -- we just use it's reference.

QFile file(fileName);
return file.remove();
}

bool AnalysisDao::saveDataToFile(QString fileName, QByteArray data) const {
bool AnalysisDao::saveDataToFile(const QString& fileName, QByteArray& data) const {
Copy link
Member

Choose a reason for hiding this comment

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

bool AnalysisDao::saveDataToFile(const QString& fileName, const QByteArray& data) const {

If track ID List is not used by the callers afterwards, use pointer;
output parameters are at the end of the parameter list.
@daschuer
Copy link
Member

daschuer commented Jul 5, 2013

LGTM! Thank you.

Please note: There is no notification send out if you add a commit. So please write a "finish" comment when you think you are finished. This way the possible reviewers will be informed.

daschuer added a commit that referenced this pull request Jul 5, 2013
Added 'const' or '&' to arguments when needed.
@daschuer daschuer merged commit 5471787 into mixxxdj:master Jul 5, 2013
@troyane
Copy link
Contributor Author

troyane commented Jul 5, 2013

Thank you, @daschuer. I'll write "finish" every time henceforward.

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.

2 participants