From fcfb1a74ddb797fc2886b6695d9f56f30bbbd556 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 19 Aug 2019 23:54:45 -0500 Subject: [PATCH] Fix chartHashValue for GlucoseChartValueHashable --- WatchApp Extension/Scenes/GlucoseChartValueHashable.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WatchApp Extension/Scenes/GlucoseChartValueHashable.swift b/WatchApp Extension/Scenes/GlucoseChartValueHashable.swift index 808ba82d47..4737a2336f 100644 --- a/WatchApp Extension/Scenes/GlucoseChartValueHashable.swift +++ b/WatchApp Extension/Scenes/GlucoseChartValueHashable.swift @@ -22,9 +22,10 @@ extension GlucoseChartValueHashable { var chartHashValue: Int { var hashValue = start.timeIntervalSinceReferenceDate.hashValue hashValue ^= end.timeIntervalSince(start).hashValue - hashValue ^= min.hashValue + // HKQuantity.hashValue returns 0, so we need to convert + hashValue ^= min.doubleValue(for: .milligramsPerDeciliter).hashValue if min != max { - hashValue ^= max.hashValue + hashValue ^= max.doubleValue(for: .milligramsPerDeciliter).hashValue } return hashValue }