From e1ad307099d798232917959ab55f124ae342d525 Mon Sep 17 00:00:00 2001 From: rizkyikiw42 Date: Sat, 25 Oct 2025 16:19:44 +0800 Subject: [PATCH] node/endpoints: prealloc map in checkModuleAvailability --- node/endpoints.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/endpoints.go b/node/endpoints.go index 14c12fd1f1..ba0799906e 100644 --- a/node/endpoints.go +++ b/node/endpoints.go @@ -53,7 +53,7 @@ func StartHTTPEndpoint(endpoint string, timeouts rpc.HTTPTimeouts, handler http. // available API services. It assumes that the MetadataApi module ("rpc") is always available; // the registration of this "rpc" module happens in NewServer() and is thus common to all endpoints. func checkModuleAvailability(modules []string, apis []rpc.API) (bad, available []string) { - availableSet := make(map[string]struct{}) + availableSet := make(map[string]struct{}, len(apis)) for _, api := range apis { if _, ok := availableSet[api.Namespace]; !ok { availableSet[api.Namespace] = struct{}{}