michaelsembwever commented on code in PR #3761:
URL: https://github.com/apache/cassandra/pull/3761#discussion_r1910149356


##########
src/java/org/apache/cassandra/cql3/VariableSpecifications.java:
##########
@@ -56,6 +59,17 @@ public List<ColumnSpecification> getBindVariables()
         return specs;
     }
 
+    public ImmutableList<ColumnSpecification> getImmutableBindVariables()
+    {
+        ImmutableList<ColumnSpecification> result = immutableSpecs;
+        if (result == null) // strong syncrhronization is not needed, it is ok 
if sometimes we create several immutable lists
+        {
+            result = ImmutableList.copyOf(specs);
+            immutableSpecs = result;
+        }
+        return result;

Review Comment:
   why not just
   ```suggestion
           return immutableSpecs == null ? immutableSpecs  = 
ImmutableList.copyOf(specs) : immutableSpecs;
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to