1919import com .github .mikephil .charting .utils .MPPointF ;
2020import com .github .mikephil .charting .utils .Utils ;
2121
22- import java .util .ArrayList ;
2322import java .util .List ;
2423import java .util .Locale ;
2524
@@ -34,7 +33,7 @@ public class PieChart extends PieRadarChartBase<PieData> {
3433 * rect object that represents the bounds of the piechart, needed for
3534 * drawing the circle
3635 */
37- private RectF mCircleBox = new RectF ();
36+ private final RectF mCircleBox = new RectF ();
3837
3938 /**
4039 * flag indicating if entry labels should be drawn or not
@@ -76,7 +75,7 @@ public class PieChart extends PieRadarChartBase<PieData> {
7675 */
7776 private CharSequence mCenterText = "" ;
7877
79- private MPPointF mCenterTextOffset = MPPointF .getInstance (0 , 0 );
78+ private final MPPointF mCenterTextOffset = MPPointF .getInstance (0 , 0 );
8079
8180 /**
8281 * indicates the size of the hole in the center of the piechart, default:
@@ -304,10 +303,9 @@ public boolean needsHighlight(int index) {
304303 if (!valuesToHighlight ())
305304 return false ;
306305
307- for (int i = 0 ; i < mIndicesToHighlight .length ; i ++)
308-
309- // check if the xvalue for the given dataset needs highlight
310- if ((int ) mIndicesToHighlight [i ].getX () == index )
306+ // check if the xvalue for the given dataset needs highlight
307+ for (Highlight highlight : mIndicesToHighlight )
308+ if ((int ) highlight .getX () == index )
311309 return true ;
312310
313311 return false ;
0 commit comments