lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [1/2] lucene-solr:jira/solr-8542-v2: SOLR-8542: initialCapacity tweak ManagedFeatureStore.featuresAsManagedResources
Date Tue, 01 Nov 2016 17:37:28 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-8542-v2 3ab2ee112 -> 91b5db341


SOLR-8542: initialCapacity tweak ManagedFeatureStore.featuresAsManagedResources


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/6182b28b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6182b28b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6182b28b

Branch: refs/heads/jira/solr-8542-v2
Commit: 6182b28b7b4b68b441369b118051d5095c6741de
Parents: 3ab2ee1
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Tue Nov 1 17:31:15 2016 +0000
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Tue Nov 1 17:31:15 2016 +0000

----------------------------------------------------------------------
 .../org/apache/solr/ltr/store/rest/ManagedFeatureStore.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6182b28b/solr/contrib/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java
----------------------------------------------------------------------
diff --git a/solr/contrib/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java
b/solr/contrib/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java
index 62b0fe5..beb217c 100644
--- a/solr/contrib/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java
+++ b/solr/contrib/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java
@@ -183,8 +183,9 @@ public class ManagedFeatureStore extends ManagedResource implements ManagedResou
   }
 
   private static List<Object> featuresAsManagedResources(FeatureStore store) {
-    final List<Object> features = new ArrayList<Object>();
-    for (final Feature f : store.getFeatures()) {
+    final List<Feature> storedFeatures = store.getFeatures();
+    final List<Object> features = new ArrayList<Object>(storedFeatures.size());
+    for (final Feature f : storedFeatures) {
       final LinkedHashMap<String,Object> m = toFeatureMap(f);
       m.put(FEATURE_STORE_NAME_KEY, store.getName());
       features.add(m);


Mime
View raw message