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

Fix some more defects and some minor tidying #589

Merged
merged 8 commits into from
Jan 3, 2015

Conversation

peternewman
Copy link
Member

No description provided.

@@ -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)) {
Copy link
Member

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;

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Switched.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 3f1de8f on peternewman:libusb into 2ec510a on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 7226990 on peternewman:libusb into 2ec510a on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 9b96cc2 on peternewman:libusb into 2ec510a on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 9b96cc2 on peternewman:libusb into 2ec510a on OpenLightingProject:master.

nomis52 added a commit that referenced this pull request Jan 3, 2015
Fix some more defects and some minor tidying
@nomis52 nomis52 merged commit 6421881 into OpenLightingProject:master Jan 3, 2015
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