mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 12:31:26 +07:00
memory optimization: do not allocate empty arrays (part of KTIJ-27475 Investigate Kotlin plugin excessive memory usage)
GitOrigin-RevId: 25de43af6bcce77ad6507809b7cf83ae4e41b44b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6f3fae4c08
commit
32a0b64911
@@ -16,12 +16,12 @@ final class Component {
|
||||
final EKey @NotNull [] ids;
|
||||
|
||||
Component(@NotNull Value value, @NotNull Collection<EKey> ids) {
|
||||
this(value, ids.toArray(new EKey[0]));
|
||||
this(value, ids.toArray(EKey.EMPTY_ARRAY));
|
||||
}
|
||||
|
||||
Component(@NotNull Value value, EKey @NotNull ... ids) {
|
||||
this.value = value;
|
||||
this.ids = ids;
|
||||
this.ids = ids.length == 0 ? EKey.EMPTY_ARRAY : ids;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Equation key (or variable)
|
||||
*/
|
||||
public final class EKey {
|
||||
public static final EKey[] EMPTY_ARRAY = new EKey[0];
|
||||
final @NotNull MemberDescriptor member;
|
||||
final int dirKey;
|
||||
final boolean stable;
|
||||
|
||||
@@ -373,7 +373,7 @@ abstract class EffectQuantum {
|
||||
CallQuantum(EKey key, DataValue[] data, boolean isStatic) {
|
||||
super((key.hashCode() * 31 + Arrays.hashCode(data)) * 31 + (isStatic ? 1 : 0));
|
||||
this.key = key;
|
||||
this.data = data;
|
||||
this.data = data.length == 0 ? DataValue.EMPTY : data;
|
||||
this.isStatic = isStatic;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ final class ELattice<T extends Enum<T>> {
|
||||
|
||||
|
||||
class ResultUtil {
|
||||
private static final EKey[] EMPTY_PRODUCT = new EKey[0];
|
||||
private static final EKey[] EMPTY_PRODUCT = EKey.EMPTY_ARRAY;
|
||||
private final ELattice<Value> lattice;
|
||||
final Value top;
|
||||
final Value bottom;
|
||||
|
||||
Reference in New Issue
Block a user