[apps/shared] Improve perf of values controller

Change-Id: I22b0f81c59d06bb8fa58de7f8958a20e0bcf53b0
This commit is contained in:
Émilie Feral
2017-06-01 13:37:27 +02:00
parent d2c55eb7d0
commit 61787593e1

View File

@@ -165,13 +165,8 @@ KDCoordinate ValuesController::cumulatedWidthFromIndex(int i) {
int ValuesController::indexFromCumulatedWidth(KDCoordinate offsetX) {
if (offsetX <= k_abscissaCellWidth) {
return 0;
} else {
int index = 0;
while ((k_abscissaCellWidth+index*k_ordinateCellWidth) <= offsetX) {
index++;
}
return index;
}
return (offsetX - k_abscissaCellWidth)/k_ordinateCellWidth+1;
}
HighlightCell * ValuesController::reusableCell(int index, int type) {