Browse Source

REPORT-89867 【降本增效】插件管理优化 去除两次for循环

feature/x
Destiny.Lin 1 year ago
parent
commit
c72da02f57
  1. 13
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

13
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -123,14 +123,10 @@ public class PluginOperateUtils {
@Override
public void run() {
List<String> pluginInfos = new ArrayList<>();
for (int i = 0, len = pluginIDs.length(); i < len; i++) {
int len = pluginIDs.length();
BatchModifyStatusCallback modifyStatusCallback = new BatchModifyStatusCallback(jsCallback, len);
for (int i = 0; i < len; i++) {
String pluginInfo = pluginIDs.get(i).asString().getValue();
pluginInfos.add(pluginInfo);
}
BatchModifyStatusCallback modifyStatusCallback = new BatchModifyStatusCallback(jsCallback, pluginIDs.length());
for (String pluginInfo : pluginInfos) {
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
dealWithPluginActive(pluginMarker, modifyStatusCallback);
}
@ -313,8 +309,7 @@ public class PluginOperateUtils {
private static String getPluginName(PluginContext pluginContext, PluginMarker pluginMarker) {
if (pluginContext != null) {
return pluginContext.getName();
}
else if (pluginMarker instanceof PluginMarkerAdapter) {
} else if (pluginMarker instanceof PluginMarkerAdapter) {
return ((PluginMarkerAdapter) pluginMarker).getPluginName();
}
return pluginMarker == null ? StringUtils.EMPTY : pluginMarker.getPluginID();

Loading…
Cancel
Save