[ 
https://issues.apache.org/jira/browse/TINKERPOP-1542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15630781#comment-15630781
 ] 

ASF GitHub Bot commented on TINKERPOP-1542:
-------------------------------------------

GitHub user okram opened a pull request:

    https://github.com/apache/tinkerpop/pull/480

    TINKERPOP-1542: Add Path.isEmpty() with a default implementation.

    https://issues.apache.org/jira/browse/TINKERPOP-1542
    
    Added `Path.isEmpty()` and `Path.head()` with default implementations. Have 
optimized implementations in `ImmutablePath` and `MutablePath`. These methods 
are used heavily by the `LP`-class of traversers. A few other random tweaks.
    
    VOTE +1.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1542

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/480.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #480
    
----
commit c2e5437275061a95105af885504abcb586b2ee2f
Author: Marko A. Rodriguez <[email protected]>
Date:   2016-11-02T22:34:43Z

    Added Path.head() and Path.isEmpty() with default method implementations. 
Have optimized implementations in ImmutablePath and MutablePath. Using methods 
in the LP-class of traverser (the most heavily used traversers).

----


> Add Path.isEmpty() with a default implementation.
> -------------------------------------------------
>
>                 Key: TINKERPOP-1542
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1542
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.3
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>
> We have lots of {{path.size() == 0}} which for {{ImmutablePath}} is a 
> recursion. A {{path.isEmpty()}} is a O(1) call. Given how heavily used 
> {{ImmutablePath}} is, we should provide {{Path.isEmpty()}} with the following 
> default implementation.
> {code}
>     public default boolean isEmpty() {
>         return this.size() == 0;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to