Skip to content

Commit d556733

Browse files
authored
Merge pull request #171 from AppDevNext/FixLint
Fix lint warning
2 parents 3299d95 + bfa38f6 commit d556733

File tree

1 file changed

+5
-7
lines changed
  • MPChartLib/src/main/java/com/github/mikephil/charting/charts

1 file changed

+5
-7
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/charts/PieChart.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.github.mikephil.charting.utils.MPPointF;
2020
import com.github.mikephil.charting.utils.Utils;
2121

22-
import java.util.ArrayList;
2322
import java.util.List;
2423
import 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

Comments
 (0)