[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-3904?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated ZOOKEEPER-3904:
--------------------------------------
    Labels: pull-request-available  (was: )

> Remove duplicate check in ContainerManager#getCandidates method
> ---------------------------------------------------------------
>
>                 Key: ZOOKEEPER-3904
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3904
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: Guo Jiwei
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> ContainerManager#getCandidates:
> ```
> if ((node != null) && node.getChildren().isEmpty()) {
>                 /*
>                     cversion > 0: keep newly created containers from being 
> deleted
>                     before any children have been added. If you were to 
> create the
>                     container just before a container cleaning period the 
> container
>                     would be immediately be deleted.
>                  */
>                 if (node.stat.getCversion() > 0) {
>                     candidates.add(containerPath);
> ```
> It has already checked the below logic, so no need to do it one more time.
> ```
> if ((node != null) && (node.stat.getCversion() > 0) && 
> (node.getChildren().isEmpty())) {
>                 candidates.add(containerPath);
>             }
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to