Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/451#discussion_r82210120
  
    --- Diff: 
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
 ---
    @@ -89,9 +100,8 @@ public DriverRemoteTraversalSideEffects(final Client 
client, final UUID serverSi
                     keys = 
client.submitAsync(msg).get().all().get().stream().map(r -> 
r.getString()).collect(Collectors.toSet());
    --- End diff --
    
    At first, I didn't like that this because it replaced the whole `Set` - if 
you'd called `get()` first then this the set would get re-initialized when it 
already had keys in it. But I suppose that's not really a problem. If you don't 
do that then you have to check if the `Set` was initialized or not and if not 
new one up:
    
    ```java
    if (keys == Collections.emptySet())
      keys = new HashSet<>();
    
    client.submitAsync(msg).get().all().get().forEach(r -> 
keys.add(r.getString())
    ````
    
    A tad nicer because it gets rid of `stream()`....i dunno either way is fine 
i guess.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to