Use std::min and std::max

This commit is contained in:
Romain Goyet
2020-04-12 15:43:39 -04:00
committed by Ecco
parent 77ee5126e1
commit 950862f8d0
79 changed files with 297 additions and 406 deletions

View File

@@ -15,6 +15,7 @@
#include "images/focused_calcul4_icon.h"
#include <poincare/preferences.h>
#include <assert.h>
#include <algorithm>
#include <cmath>
using namespace Poincare;
@@ -22,8 +23,6 @@ using namespace Shared;
namespace Probability {
static inline int minInt(int x, int y) { return x < y ? x : y; }
CalculationController::ContentView::ContentView(SelectableTableView * selectableTableView, Distribution * distribution, Calculation * calculation) :
m_titleView(KDFont::SmallFont, I18n::Message::ComputeProbability, 0.5f, 0.5f, Palette::GreyDark, Palette::WallScreen),
m_selectableTableView(selectableTableView),
@@ -293,7 +292,7 @@ void CalculationController::updateTitle() {
}
currentChar += UTF8Decoder::CodePointToChars(' ', m_titleBuffer + currentChar, k_titleBufferSize - currentChar);
}
m_titleBuffer[minInt(currentChar, k_titleBufferSize) - 1] = 0;
m_titleBuffer[std::min(currentChar, k_titleBufferSize) - 1] = 0;
}
}