Skip to content

Commit

Permalink
starting index was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmajh committed Nov 27, 2023
1 parent 52f1c63 commit 085ee68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/criticality/criticality_settings_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ List<double> 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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 085ee68

Please sign in to comment.