File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2506,12 +2506,10 @@ static MultiplexedSessionPrecommitToken getExecuteBatchDmlResponsePrecommitToken
25062506
25072507 static MultiplexedSessionPrecommitToken getPrecommitToken (
25082508 String value , ByteString transactionId ) {
2509- if (!transactionSequenceNo .containsKey (transactionId )) {
2510- transactionSequenceNo .put (transactionId , new AtomicInteger (0 ));
2511- }
2509+ transactionSequenceNo .putIfAbsent (transactionId , new AtomicInteger (0 ));
25122510
25132511 // Generates an incrementing sequence number
2514- int seqNum = transactionSequenceNo .get (transactionId ).addAndGet ( 1 );
2512+ int seqNum = transactionSequenceNo .get (transactionId ).incrementAndGet ( );
25152513 return MultiplexedSessionPrecommitToken .newBuilder ()
25162514 .setPrecommitToken (ByteString .copyFromUtf8 (value ))
25172515 .setSeqNum (seqNum )
You can’t perform that action at this time.
0 commit comments