You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by fa...@apache.org on 2022/10/12 06:19:03 UTC

[incubator-seatunnel] branch dev updated: [Improve][ST-Api] Replace the loop with 'List.replaceAll'. (#3066)

This is an automated email from the ASF dual-hosted git repository.

fanjia pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new d1aa2224b [Improve][ST-Api] Replace the loop with 'List.replaceAll'. (#3066)
d1aa2224b is described below

commit d1aa2224b6290676f5421254ae353339ea499c00
Author: FlechazoW <35...@users.noreply.github.com>
AuthorDate: Wed Oct 12 14:18:58 2022 +0800

    [Improve][ST-Api] Replace the loop with 'List.replaceAll'. (#3066)
---
 .../java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java b/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java
index 998e58bd7..e25f3daaf 100644
--- a/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java
+++ b/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConfigUtil.java
@@ -64,9 +64,7 @@ public class ConfigUtil {
 
         if (rawValue instanceof List) {
             List<Object> rawList = (List<Object>) rawValue;
-            for (int i = 0; i < rawList.size(); i++) {
-                rawList.set(i, flatteningMap(rawList.get(i), null, null, false));
-            }
+            rawList.replaceAll(value -> flatteningMap(value, null, null, false));
             if (newMap != null) {
                 newMap.put(String.join(".", keys), rawList);
                 return newMap;