mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Add some asserts in stats.
This commit is contained in:
@@ -83,6 +83,8 @@ PiePartData PiePartsPercentageByIndices(
|
||||
for (const auto &line : chartData.lines) {
|
||||
auto sum = ChartValue(0);
|
||||
for (auto i = xIndices.min; i <= xIndices.max; i++) {
|
||||
const auto index = int(base::SafeRound(i));
|
||||
Assert(index >= 0 && index < line.y.size());
|
||||
sum += line.y[i];
|
||||
}
|
||||
if (linesFilter) {
|
||||
|
@@ -303,6 +303,7 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||
if (xIndex < 0) {
|
||||
return;
|
||||
}
|
||||
Assert(xIndex < _chartData.x.size());
|
||||
{
|
||||
constexpr auto kOneDay = 3600 * 24 * 1000;
|
||||
const auto timestamp = _chartData.x[xIndex];
|
||||
@@ -328,6 +329,7 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||
= (_chartData.currency == Data::StatisticalCurrency::Credits);
|
||||
for (auto i = 0; i < _chartData.lines.size(); i++) {
|
||||
const auto &dataLine = _chartData.lines[i];
|
||||
Assert(xIndex < dataLine.y.size());
|
||||
auto textLine = Line();
|
||||
textLine.id = dataLine.id;
|
||||
if (_maxPercentageWidth) {
|
||||
|
Reference in New Issue
Block a user