Skip to content

Commit

Permalink
Fixed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-belellou committed Feb 12, 2025
1 parent 74e84fb commit 9114cf6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 16 deletions.
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/main/java/com/belellou/kevin/advent/year2015/Day19.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ private static void find(String medicine, String current, int currentIndex, Modi
if (newMedicine.equals(medicine)) {
System.out.println("Found");
throw new RuntimeException("Found");
} else if (newMedicine.length() > medicine.length()) {
// System.out.println("Too long");
// Do nothing
} else {
} else if (newMedicine.length() <= medicine.length()) {
int endIndex = newMedicine.length();
while (!medicine.startsWith(newMedicine.substring(0, endIndex))) {
endIndex--;
Expand All @@ -73,7 +70,7 @@ private static void find(String medicine, String current, int currentIndex, Modi
//
// String newCurrent =
// realCurrent.substring(0, localIndex) + s + realCurrent.substring(matchResult.end());
//// System.out.println(newCurrent);
// System.out.println(newCurrent);
// String newMedicine = prefix + newCurrent;
// System.out.println("newMedicine: " + newMedicine);
//
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/com/belellou/kevin/advent/year2015/Day24.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ private static void solve(List<Integer> packages, int index, int weightPerGroup,
// AtomicLong currentSize,
AtomicLong minSize,
// AtomicLong currentQuantum,
AtomicLong minQuantum,
List<Long> list) {
AtomicLong minQuantum, List<Long> list) {
for (int i = index - 1; i >= 0; i--) {
int currentPackage = packages.get(i);

if (currentPackage > weightLeft) {
continue;
} else if (currentPackage == weightLeft) {
if (currentPackage == weightLeft) {
// long finalSize = currentSize.get() + 1;
// long finalQuantum = currentQuantum.get() * currentPackage;
list.add((long) currentPackage);
Expand All @@ -40,7 +37,7 @@ private static void solve(List<Integer> packages, int index, int weightPerGroup,

list.removeLast();
// return;
} else {
} else if (currentPackage < weightLeft) {
// currentSize.incrementAndGet();
// currentQuantum.set(currentQuantum.get() * currentPackage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import com.belellou.kevin.advent.generic.AbstractDaySolver;

@SuppressWarnings({"unused", "preview"})
@SuppressWarnings({"unused"})
public class Day17 extends AbstractDaySolver<String, Integer> {

private static final Position startingPosition = Position.of(0, 0);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/belellou/kevin/advent/year2016/Day21.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ private static String applyOperations(List<Operation> operations, boolean revers

for (Operation operation : operations) {
switch (operation.type) {
case SWAP_POSITION -> {
ArrayUtils.swap(array, operation.firstOperand, operation.secondOperand);
}
case SWAP_POSITION -> ArrayUtils.swap(array, operation.firstOperand, operation.secondOperand);
case SWAP_LETTER -> {
int firstOperandIndex = getIndexedOf(array, operation.firstOperand);
int secondOperandIndex = getIndexedOf(array, operation.secondOperand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.belellou.kevin.advent.generic.AbstractDaySolver;
import com.belellou.kevin.advent.generic.DisableTest;

@SuppressWarnings({"unused", "preview"})
@SuppressWarnings({"unused"})
public class Day22 extends AbstractDaySolver<Integer, Integer> {

private static final String SPACE_DELIMITER_REGEX = "\\s+";
Expand Down

0 comments on commit 9114cf6

Please sign in to comment.