Skip to content

Commit

Permalink
Update iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <[email protected]>
  • Loading branch information
stephen-crawford committed Apr 24, 2023
1 parent 2b6774b commit 876871e
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

package org.opensearch.security.privileges;

import com.carrotsearch.hppc.cursors.ObjectCursor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -650,23 +649,7 @@ private boolean checkFilteredAliases(Resolved requestedResolved, String action,
indexMetaDataCollection = new Iterable<IndexMetadata>() {
@Override
public Iterator<IndexMetadata> iterator() {
final Iterator<ObjectCursor<IndexMetadata>> iterator = clusterService.state().getMetadata().getIndices().values().iterator();
return new Iterator<IndexMetadata>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}

@Override
public IndexMetadata next() {
return iterator.next().value;
}

@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
return clusterService.state().getMetadata().getIndices().values().iterator();
}
};
} else {
Expand Down

0 comments on commit 876871e

Please sign in to comment.