-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix some more defects and some minor tidying #589
Conversation
@@ -139,8 +138,9 @@ bool FtdiDmxPlugin::SetDefaultPreferences() { | |||
int unsigned FtdiDmxPlugin::GetFrequency() { | |||
unsigned int frequency; | |||
|
|||
if (!StringToInt(m_preferences->GetValue(K_FREQUENCY), &frequency)) | |||
StringToInt(DEFAULT_FREQUENCY, &frequency); | |||
if (!StringToInt(m_preferences->GetValue(K_FREQUENCY), &frequency)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd invert this, I think it's easier to read 👍
if (StringToInt(m_preferences->GetValue(K_FREQUENCY), &frequency)) {
return frequency;
}
return DEFAULT_FREQUENCY;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually thinking I might create a StringToIntOrDefault which wraps it all in one function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched.
Fix some more defects and some minor tidying
No description provided.