File tree 1 file changed +5
-1
lines changed
number-baseball/src/main/java/io/github/gunkim/baseball/domain
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public Result match(final BallNumbers otherBalls) {
19
19
final BallNumber myBall = this .ballNumbers .get (i );
20
20
final BallNumber otherBall = otherBalls .ballNumbers .get (i );
21
21
22
- if (myBall . equals ( otherBall )) {
22
+ if (isSameBallNumber ( myBall , otherBall )) {
23
23
strike ++;
24
24
} else if (hasBallNumber (otherBall )) {
25
25
ball ++;
@@ -29,6 +29,10 @@ public Result match(final BallNumbers otherBalls) {
29
29
return new Result (strike , ball );
30
30
}
31
31
32
+ private boolean isSameBallNumber (BallNumber myBall , BallNumber otherBall ) {
33
+ return myBall .equals (otherBall );
34
+ }
35
+
32
36
private boolean hasBallNumber (final BallNumber ballNumber ) {
33
37
return this .ballNumbers .contains (ballNumber );
34
38
}
You can’t perform that action at this time.
0 commit comments