Mercurial > gemma
comparison pkg/controllers/stretches.go @ 3473:d66cae5be0a1
fairway availabilty: Fixed off-by-one array access when filling LDC classification into result rows.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 27 May 2019 12:15:35 +0200 |
parents | 104c4f683c74 |
children | a6128caca3c1 |
comparison
equal
deleted
inserted
replaced
3472:71022e6bd98e | 3473:d66cae5be0a1 |
---|---|
561 | 561 |
562 duration := res.to.Sub(res.from) * time.Duration(len(loaded)) | 562 duration := res.to.Sub(res.from) * time.Duration(len(loaded)) |
563 | 563 |
564 res.ldc = durationsToPercentage(duration, ldc) | 564 res.ldc = durationsToPercentage(duration, ldc) |
565 res.breaks = durationsToPercentage(duration, breaks) | 565 res.breaks = durationsToPercentage(duration, breaks) |
566 | |
567 } | 566 } |
568 }() | 567 }() |
569 } | 568 } |
570 | 569 |
571 var results []*result | 570 var results []*result |
631 | 630 |
632 for _, res := range results { | 631 for _, res := range results { |
633 record[0] = res.label | 632 record[0] = res.label |
634 | 633 |
635 for i, v := range res.ldc { | 634 for i, v := range res.ldc { |
636 record[2+i] = fmt.Sprintf("%.3f", v) | 635 record[1+i] = fmt.Sprintf("%.3f", v) |
637 } | 636 } |
638 | 637 |
639 for i, v := range res.breaks { | 638 for i, v := range res.breaks { |
640 record[3+i] = fmt.Sprintf("%.3f", v) | 639 record[3+i] = fmt.Sprintf("%.3f", v) |
641 } | 640 } |