From c37d9b8f4513da2d2ccad28a1a3622a628fd8bfd Mon Sep 17 00:00:00 2001 From: Ali Beyad Date: Wed, 10 May 2017 13:10:50 -0400 Subject: [PATCH] simpler remove logic --- .../cluster/snapshots/get/TransportGetSnapshotsAction.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java index 557627f1b10f3..eec218a4119ba 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java @@ -164,9 +164,8 @@ private List buildSimpleSnapshotInfos(final Set toReso final List currentSnapshots) { List snapshotInfos = new ArrayList<>(); for (SnapshotInfo snapshotInfo : currentSnapshots) { - if (toResolve.contains(snapshotInfo.snapshotId())) { + if (toResolve.remove(snapshotInfo.snapshotId())) { snapshotInfos.add(snapshotInfo.basic()); - toResolve.remove(snapshotInfo.snapshotId()); } } Map> snapshotsToIndices = new HashMap<>();