Skip to content

Commit

Permalink
Merge pull request #26 from technototes/BugFix
Browse files Browse the repository at this point in the history
Fixed a hard size limitation on logging entries. Hopefully no more crashing
  • Loading branch information
kevinfrei committed Dec 15, 2022
2 parents e6809c9 + 3590ab9 commit 7b9f89f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -89,13 +90,17 @@ private void configure(Object root) {
}

// TODO make list and do sort with comparators
// List<List<Entry<?>>
// I wish this had a comment describing what Alex thinks it's doing,
// I *think* it'strying to set the 'indexed' entries to their preferred locations
// then filling in the gaps with unindexed or lower priority entries.
// That bottom loop is also quite slow, but we're talking about 0-20 entries, so performance
// is probably irrelevant...
private Entry<?>[] generate(Set<Entry<?>> a) {
Entry<?>[] returnEntry = new Entry[10];
Entry<?>[] returnEntry = new Entry[a.size()];
List<Entry<?>> unindexed = new ArrayList<>();
for (Entry<?> e : a) {
int index = e.getIndex();
if (index != -1) {
if (index >= 0 && index < returnEntry.length) {
Entry<?> other = returnEntry[index];
if (other == null) {
returnEntry[index] = e;
Expand All @@ -116,7 +121,6 @@ private Entry<?>[] generate(Set<Entry<?>> a) {
returnEntry[i] = unindexed.remove(0);
}
}

return returnEntry;
}

Expand Down

0 comments on commit 7b9f89f

Please sign in to comment.