From 085ee6875c1ed72b44cbc17c0b86b6d6264e8bae Mon Sep 17 00:00:00 2001 From: Jonathan Ma Date: Mon, 27 Nov 2023 15:09:27 -0500 Subject: [PATCH] starting index was incorrect --- lib/criticality/criticality_settings_notifier.dart | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/criticality/criticality_settings_notifier.dart b/lib/criticality/criticality_settings_notifier.dart index 058e0a3..52bf628 100644 --- a/lib/criticality/criticality_settings_notifier.dart +++ b/lib/criticality/criticality_settings_notifier.dart @@ -296,13 +296,13 @@ List calculateSingleCutoff({ if (target == 100) { return [0, sortedUniqueRPNs.last, totalRPNCount.toDouble()]; } - int i = 1; + int i = 0; double currentPercent = 0; double previousPercent = 0; int sumRPNs = 0; int previousSumRpn = 0; // calculation for very low - while (i <= sortedUniqueRPNs.length) { + while (i < sortedUniqueRPNs.length) { sumRPNs = sumRPNs + frequencyOfRPNs[sortedUniqueRPNs[i]]!; currentPercent = sumRPNs / totalRPNCount * 100; // keep going to the next value until the new percentage is larger than previous percentage diff --git a/pubspec.yaml b/pubspec.yaml index 2ec4d11..caee23d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: IKO Reliability Tool publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.3.0 +version: 1.3.1 environment: sdk: '>=3.0.0 <=4.0.0'