Skip to content

Commit ed99f58

Browse files
authored
Now it's OK!
1 parent f8605b9 commit ed99f58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ciphers/Caesar.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public class Caesar {
2424
public static String encode(String message, int shift) {
2525
String encoded = "";
2626

27-
if (shift >= 26) { // 26 = number of latin letters
28-
shift %= 26;
29-
}
27+
28+
shift %= 26;
29+
3030

3131
final int length = message.length();
3232
for (int i = 0; i < length; i++) {
@@ -62,9 +62,9 @@ public static String encode(String message, int shift) {
6262
public static String decode(String encryptedMessage, int shift) {
6363
String decoded = "";
6464

65-
if (shift >= 26) { // 26 = number of latin letters
66-
shift %= 26;
67-
}
65+
66+
shift %= 26;
67+
6868

6969
final int length = encryptedMessage.length();
7070
for (int i = 0; i < length; i++) {

0 commit comments

Comments
 (0)