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

@@ -3,11 +3,10 @@
#include "../constant.h"
#include <assert.h>
#include <cmath>
#include <algorithm>
using namespace Poincare;
static inline int maxInt(int x, int y) { return x > y ? x : y; }
namespace Shared {
EditableCellTableViewController::EditableCellTableViewController(Responder * parentResponder) :
@@ -60,7 +59,7 @@ bool EditableCellTableViewController::textFieldDidFinishEditing(TextField * text
int EditableCellTableViewController::numberOfRows() const {
int numberOfModelElements = 0;
for (int i = 0; i < numberOfColumns(); i++) {
numberOfModelElements = maxInt(numberOfModelElements, numberOfElementsInColumn(i));
numberOfModelElements = std::max(numberOfModelElements, numberOfElementsInColumn(i));
}
return 1 + numberOfModelElements + (numberOfModelElements < maxNumberOfElements());
}