Skip to content

Commit

Permalink
Used pattern instead of &&.
Browse files Browse the repository at this point in the history
  • Loading branch information
Breno RdV committed Jun 6, 2024
1 parent 9346c75 commit c0c5703
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class TimeInRangeCalculatorHandler: BaseCalculatorHandler
protected override CalculationData RunCalculation(CalculationData data)
{
var low = data.GlucoseValues.Count(v => v < GlucoseConstants.LowGlucoseThreshold);
var normal = data.GlucoseValues.Count(v => v >= GlucoseConstants.LowGlucoseThreshold && v < GlucoseConstants.HighGlucoseThreshold);
var high = data.GlucoseValues.Count(v => v >= GlucoseConstants.HighGlucoseThreshold && v <= GlucoseConstants.VeryHighGlucoseThreshold);
var normal = data.GlucoseValues.Count(v => v is >= GlucoseConstants.LowGlucoseThreshold and < GlucoseConstants.HighGlucoseThreshold);
var high = data.GlucoseValues.Count(v => v is >= GlucoseConstants.HighGlucoseThreshold and <= GlucoseConstants.VeryHighGlucoseThreshold);
var veryHigh = data.GlucoseValues.Count(v => v > GlucoseConstants.VeryHighGlucoseThreshold);

return data with
Expand Down

0 comments on commit c0c5703

Please sign in to comment.