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

@@ -1,12 +1,11 @@
#include "list_controller.h"
#include "../app.h"
#include <assert.h>
#include <algorithm>
using namespace Shared;
using namespace Poincare;
static inline KDCoordinate maxCoordinate(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; }
namespace Sequence {
ListController::ListController(Responder * parentResponder, ::InputEventHandlerDelegate * inputEventHandlerDelegate, ButtonRowController * header, ButtonRowController * footer) :
@@ -55,7 +54,7 @@ KDCoordinate ListController::expressionRowHeight(int j) {
return defaultHeight;
}
KDCoordinate sequenceHeight = layout.layoutSize().height();
return maxCoordinate(defaultHeight, sequenceHeight + 2*k_expressionCellVerticalMargin);
return std::max(defaultHeight, sequenceHeight + 2*k_expressionCellVerticalMargin);
}
void ListController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {