Skip to content

Commit 4a08790

Browse files
committed
minor code simplification in MultiIdentifierLoadAccessImpl
1 parent eb5acfe commit 4a08790

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

hibernate-core/src/main/java/org/hibernate/internal/MultiIdentifierLoadAccessImpl.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,7 @@ public Integer getBatchSize() {
8989

9090
@Override
9191
public MultiIdentifierLoadAccess<T> withBatchSize(int batchSize) {
92-
if ( batchSize < 1 ) {
93-
this.batchSize = null;
94-
}
95-
else {
96-
this.batchSize = batchSize;
97-
}
92+
this.batchSize = batchSize < 1 ? null : batchSize;
9893
return this;
9994
}
10095

@@ -186,16 +181,9 @@ public List<T> perform(Supplier<List<T>> executor) {
186181
@Override
187182
@SuppressWarnings( "unchecked" )
188183
public <K> List<T> multiLoad(List<K> ids) {
189-
if ( ids.isEmpty() ) {
190-
return emptyList();
191-
}
192-
else {
193-
return perform( () -> (List<T>) entityPersister.multiLoad(
194-
ids.toArray( new Object[0] ),
195-
session,
196-
this
197-
) );
198-
}
184+
return ids.isEmpty()
185+
? emptyList()
186+
: perform( () -> (List<T>) entityPersister.multiLoad( ids.toArray(), session, this ) );
199187
}
200188

201189
@Override

0 commit comments

Comments
 (0)