Skip to content

Commit fe10b6b

Browse files
committed
[java] [student_grades] Inline variable
1 parent 02b3c2e commit fe10b6b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/java/java-student_grades-02_extract_method/src/main/java/tv/codely/student_grades/StudentGradeCalculator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public StudentGradeCalculator(final int yearToCalculate) {
3131

3232
public float calculateGrades(final List<Pair<Integer, Float>> examsGrades, final boolean hasReachedMinimumClasses) {
3333
if (!examsGrades.isEmpty()) {
34-
boolean hasToIncreaseOneExtraPoint = hasToIncreaseOneExtraPoint();
35-
3634
float gradesSum = 0f;
3735
int gradesWeightSum = 0;
3836

@@ -43,7 +41,7 @@ public float calculateGrades(final List<Pair<Integer, Float>> examsGrades, final
4341

4442
if (gradesWeightSum == 100) {
4543
if (hasReachedMinimumClasses) {
46-
if (hasToIncreaseOneExtraPoint) {
44+
if (hasToIncreaseOneExtraPoint()) {
4745
return Float.min(10f, gradesSum + 1);
4846
} else {
4947
return gradesSum;

0 commit comments

Comments
 (0)