HHH-15325 Avoid allocations from BitSet.stream() in AbstractEntityPersister

This commit is contained in:
Christoph Dreis 2022-06-15 10:03:58 +02:00 committed by Christian Beikov
parent 4159a7b8dc
commit a69ffc8b0a
1 changed files with 2 additions and 2 deletions

View File

@ -2287,7 +2287,7 @@ public abstract class AbstractEntityPersister
// We have to check the state for "mutable" properties as dirty tracking isn't aware of mutable types
final Type[] propertyTypes = entityMetamodel.getPropertyTypes();
final boolean[] propertyCheckability = entityMetamodel.getPropertyCheckability();
mutablePropertiesIndexes.stream().forEach( i -> {
for ( int i = mutablePropertiesIndexes.nextSetBit(0); i >= 0; i = mutablePropertiesIndexes.nextSetBit(i + 1) ) {
// This is kindly borrowed from org.hibernate.type.TypeHelper.findDirty
final boolean dirty = currentState[i] != LazyPropertyInitializer.UNFETCHED_PROPERTY &&
// Consider mutable properties as dirty if we don't have a previous state
@ -2302,7 +2302,7 @@ public abstract class AbstractEntityPersister
if ( dirty ) {
fields.add( i );
}
} );
}
}
if ( attributeNames != null ) {