CalvinKirs commented on a change in pull request #1375:
URL: 
https://github.com/apache/shardingsphere-elasticjob/pull/1375#discussion_r470979453



##########
File path: 
elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepository.java
##########
@@ -34,16 +33,7 @@
     
     synchronized void put(final JobKey jobKey, final String jobName) {
         remove(jobName);
-        List<String> taskList = cronTasks.get(jobKey);
-        if (null == taskList) {
-            taskList = new CopyOnWriteArrayList<>();
-            taskList.add(jobName);
-            cronTasks.put(jobKey, taskList);
-            return;
-        }
-        if (!taskList.contains(jobName)) {
-            taskList.add(jobName);
-        }
+        cronTasks.computeIfAbsent(jobKey, k -> 
Collections.singletonList(jobName));

Review comment:
       Thank you very much for your review, so the previous code should be 
missing, right? On line 45, it is not updated




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to