replace ArrayList with HashSet for rpcMethodExists check (#5708)

Signed-off-by: thinkAfCod <q315xia@163.com>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
pull/5727/head
thinkAfCod 1 year ago committed by GitHub
parent 1c099e8970
commit ba2fc3d667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java

@ -14,8 +14,8 @@
*/
package org.hyperledger.besu.ethereum.api.jsonrpc;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
public enum RpcMethod {
ADMIN_ADD_PEER("admin_addPeer"),
@ -192,7 +192,7 @@ public enum RpcMethod {
}
static {
allMethodNames = new ArrayList<>();
allMethodNames = new HashSet<>();
for (RpcMethod m : RpcMethod.values()) {
allMethodNames.add(m.getMethodName());
}

Loading…
Cancel
Save