From e131593da1771f4ef30c12367adef22d99972344 Mon Sep 17 00:00:00 2001 From: Sergey Nuyanzin Date: Mon, 20 Nov 2023 23:12:24 +0100 Subject: [PATCH] Check for contains by String rather than creating extra array Signed-off-by: Sergey Nuyanzin --- .../io/aiven/klaw/service/KafkaConnectControllerService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/service/KafkaConnectControllerService.java b/core/src/main/java/io/aiven/klaw/service/KafkaConnectControllerService.java index 006a7a9af6..8f68d62344 100644 --- a/core/src/main/java/io/aiven/klaw/service/KafkaConnectControllerService.java +++ b/core/src/main/java/io/aiven/klaw/service/KafkaConnectControllerService.java @@ -911,8 +911,9 @@ private ApiResponse processRestErrorResponse(HttpStatusCodeException e, String d } private boolean checkInPromotionOrder(String envId, String orderOfEnvs) { - List orderedEnv = Arrays.asList(orderOfEnvs.split(",")); - return orderedEnv.contains(envId); + return orderOfEnvs.startsWith(envId + ",") + || orderOfEnvs.endsWith("," + envId) + || orderOfEnvs.contains("," + envId + ","); } public List getConnectorRequests(