Skip to content

Commit

Permalink
HHH-15325 Avoid allocations from BitSet.stream() in AbstractEntityPer…
Browse files Browse the repository at this point in the history
…sister
  • Loading branch information
dreis2211 authored and beikov committed Jun 15, 2022
1 parent 4159a7b commit a69ffc8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ public int[] resolveDirtyAttributeIndexes(
// 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
Expand All @@ -2302,7 +2302,7 @@ public int[] resolveDirtyAttributeIndexes(
if ( dirty ) {
fields.add( i );
}
} );
}
}

if ( attributeNames != null ) {
Expand Down

0 comments on commit a69ffc8

Please sign in to comment.