[
https://issues.apache.org/jira/browse/HDFS-15786?focusedWorklogId=540381&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-540381
]
ASF GitHub Bot logged work on HDFS-15786:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Jan/21 22:46
Start Date: 22/Jan/21 22:46
Worklog Time Spent: 10m
Work Description: goiri commented on pull request #2641:
URL: https://github.com/apache/hadoop/pull/2641#issuecomment-765728666
@belugabehr this is right in your area :)
Even without the performance improvement, I tend to prefer isEmpty() as it
has a clear semantic.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 540381)
Time Spent: 20m (was: 10m)
> 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
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> 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.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]