Skip to content

Commit

Permalink
Check for contains by String rather than creating extra array
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Nuyanzin <snuyanzin@gmail.com>
  • Loading branch information
snuyanzin committed Nov 20, 2023
1 parent cd1218a commit e131593
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,9 @@ private ApiResponse processRestErrorResponse(HttpStatusCodeException e, String d
}

private boolean checkInPromotionOrder(String envId, String orderOfEnvs) {
List<String> orderedEnv = Arrays.asList(orderOfEnvs.split(","));
return orderedEnv.contains(envId);
return orderOfEnvs.startsWith(envId + ",")
|| orderOfEnvs.endsWith("," + envId)
|| orderOfEnvs.contains("," + envId + ",");
}

public List<KafkaConnectorRequestsResponseModel> getConnectorRequests(
Expand Down

0 comments on commit e131593

Please sign in to comment.