Skip to content

Commit 7955947

Browse files
committed
Cleanup code
1 parent a13abc4 commit 7955947

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/components/LimitLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class LimitLine extends ComponentBase {
1717

1818
/** limit / maximum (the y-value or xIndex) */
19-
private float mLimit;
19+
private final float mLimit;
2020

2121
/** the width of the limit line */
2222
private float mLineWidth = 2f;
@@ -130,7 +130,7 @@ public void disableDashedLine() {
130130
* disabled
131131
*/
132132
public boolean isDashedLineEnabled() {
133-
return mDashPathEffect == null ? false : true;
133+
return mDashPathEffect != null;
134134
}
135135

136136
/**

MPChartLib/src/main/java/com/github/mikephil/charting/components/LimitRange.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public float getHigh() {
3939
/**
4040
* limit / maximum (the y-value or xIndex)
4141
*/
42-
private Range mLimit;
42+
private final Range mLimit;
4343

4444
/**
4545
* the width of the limit line
@@ -182,7 +182,7 @@ public void disableDashedLine() {
182182
* disabled
183183
*/
184184
public boolean isDashedLineEnabled() {
185-
return mDashPathEffect == null ? false : true;
185+
return mDashPathEffect != null;
186186
}
187187

188188
/**

MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import java.util.ArrayList;
88
import java.util.List;
99

10+
import androidx.annotation.NonNull;
11+
1012
/**
1113
* The DataSet class represents one group or type of entries (Entry) in the
1214
* Chart that belong together. It is designed to logically separate different
@@ -254,7 +256,7 @@ public void clear() {
254256
}
255257

256258
@Override
257-
public boolean addEntry(T entry) {
259+
public boolean addEntry(@NonNull T entry) {
258260
List<T> values = getEntries();
259261
if (values == null) {
260262
values = new ArrayList<>();

MPChartLib/src/main/java/com/github/mikephil/charting/data/LineDataSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public void disableDashedLine() {
226226

227227
@Override
228228
public boolean isDashedLineEnabled() {
229-
return mDashPathEffect == null ? false : true;
229+
return mDashPathEffect != null;
230230
}
231231

232232
@Override

0 commit comments

Comments
 (0)