[
https://issues.apache.org/jira/browse/HDFS-15786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735758#comment-17735758
]
ASF GitHub Bot commented on HDFS-15786:
---------------------------------------
arturobernalg closed pull request #2643: [HDFS-15786] - Minor improvement use
isEmpty
URL: https://github.com/apache/hadoop/pull/2643
> Minor improvement use isEmpty
> -----------------------------
>
> Key: HDFS-15786
> URL: https://issues.apache.org/jira/browse/HDFS-15786
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Arturo Bernal
> Assignee: Arturo Bernal
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 3.5h
> Remaining Estimate: 0h
>
> Use isEmpty instead size() > o.
>
> {{size()}} can be *O(1)* or *O(N)*, depending on the {{data structure}};
> {{.isEmpty()}} is never *O(N)*.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]