ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java | 8 +++----- sw/source/core/attr/swatrset.cxx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-)
New commits: commit 1064a0d941099203fb5781edf599274dbf078931 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 30 19:29:17 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 30 21:45:13 2023 +0200 cid#1545766 silence Unguarded read a bit zealous here, its all on the same thread as it turns out Change-Id: Ic2e8d8eba4fea672fa56c88abedb853fd886cecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157437 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java index 7afff73048f5..d408046b13ed 100644 --- a/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java +++ b/ridljar/com/sun/star/lib/connections/websocket/WebsocketConnection.java @@ -201,11 +201,9 @@ public class WebsocketConnection extends WebSocketClient implements XConnection, public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException { - byte[] accumulatedBytes; - synchronized (_outputStream) { - accumulatedBytes = _outputStream.toByteArray(); - _outputStream.reset(); - } + byte[] accumulatedBytes = _outputStream.toByteArray(); + _outputStream.reset(); + byte[] outputBytes = new byte[accumulatedBytes.length + outgoingPrefix.length]; System.arraycopy(outgoingPrefix, 0, outputBytes, 0, outgoingPrefix.length); System.arraycopy(accumulatedBytes, 0, outputBytes, outgoingPrefix.length, accumulatedBytes.length); commit d8be0f46db22c1d73816acd5df37f7082dc46c23 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Sep 30 19:27:23 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Sep 30 21:45:07 2023 +0200 cid#1546839 Logically dead code Change-Id: Id4c97f0f18a88ee973acdb9a8e703f0ed3c5ee1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157436 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 28f7b2dfc9eb..b08026a1bd34 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -322,7 +322,7 @@ int SwAttrSet::Intersect_BC( const SfxItemSet& rSet, SfxItemSet::Intersect( rSet ); clearCallback(); m_pOldSet = m_pNewSet = nullptr; - return pNew ? pNew->Count() : ( pOld ? pOld->Count() : 0 ); + return pNew ? pNew->Count() : pOld->Count(); } /** special treatment for some attributes
