Skip to content

Commit

Permalink
avoid default when switching on UnitType (facebook#46146)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46146

Changelog: [Internal]

`unit` is of type `UnitType`, so there's no reason to have a default case here.

i found this because my build failed when pulling in this dependency, there was a compiler flag that enforced that all cases must be enumerated. this seems like the right practice anyways.

Reviewed By: NickGerleman

Differential Revision: D61635463

fbshipit-source-id: b84b5518f2a17e792309f85ae91514a17abad295
  • Loading branch information
philIip authored and facebook-github-bot committed Aug 22, 2024
1 parent 524a3f0 commit 42dcfdd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ValueUnit {
return value;
case UnitType::Percent:
return value * referenceLength * 0.01f;
default:
case UnitType::Undefined:
return 0.0f;
}
}
Expand Down

0 comments on commit 42dcfdd

Please sign in to comment.