From d0bd04b6d3fb65e753b9103e9babeb14aa4c7ffa Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 5 Jul 2019 21:32:19 +0100 Subject: [PATCH] HHH-13496 Prefer #addAll method usage rather than looping --- .../hibernate/hql/internal/classic/QueryTranslatorImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java index 7f4432e1f6..b86f881b60 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java @@ -650,10 +650,7 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator } else { rtsize = returnedTypes.size(); - Iterator iter = entitiesToFetch.iterator(); - while ( iter.hasNext() ) { - returnedTypes.add( iter.next() ); - } + returnedTypes.addAll( entitiesToFetch ); } int size = returnedTypes.size(); persisters = new Queryable[size];