Skip to content

Commit

Permalink
[Java] Remove double read of volatile and reverse elements of condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Jan 9, 2024
1 parent ba5deb8 commit 04ce545
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,9 @@ int sendPendingStatusMessage(final long nowNs)
int workCount = 0;
final long changeNumber = endSmChange;
final boolean hasSmTimedOut = (timeOfLastSmNs + smTimeoutNs) - nowNs < 0;
final Integer responseSessionId;

if (null != responseSessionId && hasSmTimedOut)
if (hasSmTimedOut && null != (responseSessionId = this.responseSessionId))
{
channelEndpoint.sendResponseSetup(imageConnections, sessionId, streamId, responseSessionId);
}
Expand Down

0 comments on commit 04ce545

Please sign in to comment.