Skip to content

Commit 685a7bf

Browse files
committed
Remove unneded commented-out code
1 parent a5c6f5a commit 685a7bf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/HiresTileModel.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,15 @@ private void sort() {
628628
MergeSort.mergeSortInt(materialIndexSort, 0, size, this::compareMaterialIndex, materialIndexSortSupport);
629629

630630
// move
631-
int s;
631+
int s, c;
632632
for (int i = 0; i < size; i++) {
633-
s = materialIndexSort[i];
634-
while (s < i) s = materialIndexSort[s];
633+
s = materialIndexSort[i]; c = 0;
634+
while (s < i) {
635+
s = materialIndexSort[s];
636+
637+
// should never happen, just making absolutely sure this can't get stuck in an endless loop
638+
if (c++ > size) throw new IllegalStateException();
639+
}
635640
swap(i, s);
636641
}
637642
}
@@ -696,11 +701,6 @@ private void swap(int face1, int face2) {
696701
vi = materialIndex[face1];
697702
materialIndex[face1] = materialIndex[face2];
698703
materialIndex[face2] = vi;
699-
700-
//swap material-index-sort (assuming FI_MATERIAL_INDEX = 1)
701-
//vi = materialIndexSort[face1];
702-
//materialIndexSort[face1] = materialIndexSort[face2];
703-
//materialIndexSort[face2] = vi;
704704
}
705705

706706
private static void calculateSurfaceNormal(

0 commit comments

Comments
 (0)