Document the reason for lack of optimization

This commit is contained in:
embeddedt 2026-01-23 20:20:48 -05:00
parent 4dcdf09a01
commit a70f76a34d
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -66,6 +66,8 @@ public class ModFileScanDataCompactor {
a.annotationData().entrySet().stream().collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, e -> {
Object annValue = e.getValue();
if (annValue instanceof ArrayList<?> list) {
// We cannot properly compact annValue using List.of() because there are mods that
// (unnecessarily) rely on the list implementation being ArrayList.
list.trimToSize();
}
return annValue;