vkagamlyk commented on code in PR #2919:
URL: https://github.com/apache/tinkerpop/pull/2919#discussion_r1858954910


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/CollectionUtil.java:
##########
@@ -74,4 +96,22 @@ public static <K,V> ConcurrentHashMap<K,V> clone(final 
ConcurrentHashMap<K,V> ma
 
         return result;
     }
+
+    /**
+     * Adds the element argument to the start of the supplied array argument, 
but if the array is null then return the
+     * element as a new array with just that item in it.
+     */
+    public static <T> T[] addFirst(final T[] array, final T element, final 
Class<T> clazz) {
+        if (null == array && null == element) {

Review Comment:
   if element is null then
   `singleElementArray[0] = null;` and `singleElementArray[0] = null;` is the 
same
   so this `if` branch not needed



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to