Skip to content

Commit

Permalink
avoid default when switching on UnitType
Browse files Browse the repository at this point in the history
Summary:
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.

Differential Revision: D61635463
  • Loading branch information
philIip authored and facebook-github-bot committed Aug 21, 2024
1 parent 81a41ec commit a33e025
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 a33e025

Please sign in to comment.