From e043d8a2eb9a6e2fa8bd9fc32aceea2ad83dbca9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 12 Mar 2022 15:21:24 +0000 Subject: [PATCH] use array.Empty --- OpenSim/Addons/Groups/GroupsModule.cs | 8 +++---- .../Handlers/GetTexture/GetTextureHandler.cs | 2 +- .../GetTexture/GetTextureRobustHandler.cs | 2 +- OpenSim/Capabilities/LLSDStreamHandler.cs | 5 ++-- OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 +- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 2 +- OpenSim/Framework/GridInstantMessage.cs | 4 ++-- .../Serialization/TarArchiveWriter.cs | 2 +- .../Servers/HttpServer/BaseHttpServer.cs | 2 +- .../Servers/HttpServer/BaseStreamHandler.cs | 3 ++- .../BaseStreamHandlerBasicDOSProtector.cs | 5 ++-- .../HttpServer/WebsocketServerHandler.cs | 7 +++--- .../ClientStack/Linden/UDP/LLClientView.cs | 12 +++++----- .../AssetTransaction/AssetXferUploader.cs | 2 +- .../CoreModules/Agent/Xfer/XferModule.cs | 2 +- .../Avatar/Friends/CallingCardModule.cs | 2 +- .../Avatar/Friends/HGFriendsModule.cs | 2 +- .../InstantMessage/MessageTransferModule.cs | 4 ++-- .../CoreModules/Avatar/Lure/HGLureModule.cs | 2 +- .../CoreModules/Avatar/Lure/LureModule.cs | 4 ++-- .../DynamicTexture/DynamicTextureModule.cs | 4 ++-- .../LoadImageURL/LoadImageURLModule.cs | 2 +- .../VectorRender/VectorRenderModule.cs | 2 +- .../World/Estate/EstateConnector.cs | 6 ++--- .../World/Estate/EstateTerrainXferHandler.cs | 2 +- .../World/WorldMap/WorldMapModule.cs | 4 ++-- .../Framework/Scenes/SceneObjectPart.cs | 4 ++-- .../Scenes/SceneObjectPartInventory.cs | 10 ++++---- .../Server/IRCClientView.cs | 2 +- .../Avatar/XmlRpcGroups/GroupsModule.cs | 8 +++---- .../World/MoneyModule/SampleMoneyModule.cs | 2 +- .../OptionalModules/World/NPC/NPCAvatar.cs | 4 ++-- .../World/WorldView/WorldViewModule.cs | 2 +- .../WorldView/WorldViewRequestHandler.cs | 24 +++++++++---------- .../Region/PhysicsModules/BulletS/BSShapes.cs | 4 ++-- .../Handlers/Asset/AssetServerGetHandler.cs | 12 +++++----- .../AuthenticationServerPostHandler.cs | 2 +- .../Server/Handlers/BakedTextures/XBakes.cs | 2 +- .../InstantMessageServerConnector.cs | 13 ++++------ .../Handlers/Map/MapGetServerConnector.cs | 6 ++--- .../Services/FSAssetService/FSAssetService.cs | 4 ++-- .../MapImageService/MapImageService.cs | 2 +- .../MuteListService/MuteListService.cs | 4 ++-- OpenSim/Tests/Common/Mock/TestClient.cs | 2 +- .../Common/Mock/TestEventQueueGetModule.cs | 2 +- 45 files changed, 100 insertions(+), 103 deletions(-) diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 11d5f9d5c4..153b22fbe8 100755 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -401,7 +401,7 @@ namespace OpenSim.Groups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = UUID.Zero.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); OutgoingInstantMessage(msg, invitee); IClientAPI inviteeClient = GetActiveRootClient(invitee); @@ -1117,7 +1117,7 @@ namespace OpenSim.Groups msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); ; msg.fromAgentName = string.Empty; msg.message = string.Empty; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); ; } return msg; @@ -1276,7 +1276,7 @@ namespace OpenSim.Groups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = regionInfo.RegionID.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); ; OutgoingInstantMessage(msg, ejecteeID); } @@ -1294,7 +1294,7 @@ namespace OpenSim.Groups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = regionInfo.RegionID.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); ; OutgoingInstantMessage(msg, agentID); } diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 51332bc664..5ead2216c5 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs @@ -292,7 +292,7 @@ namespace OpenSim.Capabilities.Handlers private byte[] ConvertTextureData(AssetBase texture, string format) { m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format); - byte[] data = new byte[0]; + byte[] data = Array.Empty(); ; MemoryStream imgstream = new MemoryStream(); Bitmap mTexture = null; diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs index 92e819d3da..04a02a0ff8 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureRobustHandler.cs @@ -320,7 +320,7 @@ namespace OpenSim.Capabilities.Handlers private byte[] ConvertTextureData(AssetBase texture, string format) { m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format); - byte[] data = new byte[0]; + byte[] data = Array.Empty(); ; MemoryStream imgstream = new MemoryStream(); Bitmap mTexture = null; diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs index 4f1b10a4bb..e372c18798 100644 --- a/OpenSim/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Capabilities/LLSDStreamHandler.cs @@ -25,10 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections; using System.IO; -using System.Text; -using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; namespace OpenSim.Framework.Capabilities @@ -62,7 +61,7 @@ namespace OpenSim.Framework.Capabilities Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); if(hash == null) - return new byte[0]; + return Array.Empty(); TRequest llsdRequest = new TRequest(); LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest); diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 09374ca89b..2a5b765324 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1592,7 +1592,7 @@ namespace OpenSim.Data.MySQL if (prim.KeyframeMotion != null) cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize()); else - cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]); + cmd.Parameters.AddWithValue("KeyframeMotion", Array.Empty()); if (prim.PhysicsInertia != null) cmd.Parameters.AddWithValue("PhysInertia", prim.PhysicsInertia.ToXml2()); diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 64ca73dc8a..d2270acc78 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -2170,7 +2170,7 @@ namespace OpenSim.Data.SQLite if (prim.KeyframeMotion != null) row["KeyframeMotion"] = prim.KeyframeMotion.Serialize(); else - row["KeyframeMotion"] = new Byte[0]; + row["KeyframeMotion"] = Array.Empty(); ; row["PassTouches"] = prim.PassTouches; row["PassCollisions"] = prim.PassCollisions; diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs index 1605005a8a..7f3980bdf1 100644 --- a/OpenSim/Framework/GridInstantMessage.cs +++ b/OpenSim/Framework/GridInstantMessage.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework public GridInstantMessage() { - binaryBucket = new byte[0]; + binaryBucket = Array.Empty(); ; } public GridInstantMessage(GridInstantMessage im, bool addTimestamp) @@ -108,7 +108,7 @@ namespace OpenSim.Framework string _message, bool _offline, Vector3 _position) : this(scene, _fromAgentID, _fromAgentName, _toAgentID, _dialog, false, _message, - _fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true) + _fromAgentID ^ _toAgentID, _offline, _position, Array.Empty(), true) { } } diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index a5c3d0ae6e..fbd88af791 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs @@ -61,7 +61,7 @@ namespace OpenSim.Framework.Serialization if (!dirName.EndsWith("/")) dirName += "/"; - WriteFile(dirName, new byte[0]); + WriteFile(dirName, Array.Empty()); } /// diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ddc65d3b39..0d624668a9 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1615,7 +1615,7 @@ namespace OpenSim.Framework.Servers.HttpServer return null; } - byte[] buffer = new byte[0]; + byte[] buffer = Array.Empty(); if (llsdResponse.ToString() == "shutdown404!") { response.ContentType = "text/plain"; diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs index 7fc9f0b881..b47e8095e4 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.IO; using System.Net; using OpenSim.Framework.ServiceAuth; @@ -65,7 +66,7 @@ namespace OpenSim.Framework.Servers.HttpServer { httpResponse.StatusCode = (int)statusCode; httpResponse.ContentType = "text/plain"; - return new byte[0]; + return Array.Empty(); } } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs index 9619e0367e..b3b8098541 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandlerBasicDOSProtector.cs @@ -24,7 +24,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using OpenSim.Framework; + +using System; using System.IO; namespace OpenSim.Framework.Servers.HttpServer @@ -78,7 +79,7 @@ namespace OpenSim.Framework.Servers.HttpServer protected virtual byte[] ThrottledRequest( string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { - return new byte[0]; + return Array.Empty(); } diff --git a/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs b/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs index a6361fe30b..a02946a9a1 100644 --- a/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/WebsocketServerHandler.cs @@ -580,7 +580,8 @@ namespace OpenSim.Framework.Servers.HttpServer _receiveDone.Set(); _initialMsgTimeout = 0; } - WebSocketFrame pingFrame = new WebSocketFrame() { Header = WebsocketFrameHeader.HeaderDefault(), WebSocketPayload = new byte[0] }; + WebSocketFrame pingFrame = new WebSocketFrame() { Header = WebsocketFrameHeader.HeaderDefault(), WebSocketPayload = Array.Empty() + }; pingFrame.Header.Opcode = WebSocketReader.OpCode.Ping; pingFrame.Header.IsEnd = true; _pingtime = Util.EnvironmentTickCount(); @@ -651,7 +652,7 @@ namespace OpenSim.Framework.Servers.HttpServer pingD(this, new PingEventArgs()); } - WebSocketFrame pongFrame = new WebSocketFrame(){Header = WebsocketFrameHeader.HeaderDefault(),WebSocketPayload = new byte[0]}; + WebSocketFrame pongFrame = new WebSocketFrame(){Header = WebsocketFrameHeader.HeaderDefault(),WebSocketPayload = Array.Empty()}; pongFrame.Header.Opcode = WebSocketReader.OpCode.Pong; pongFrame.Header.IsEnd = true; SendSocket(pongFrame.ToBytes()); @@ -960,7 +961,7 @@ dec 0 1 2 3 * When reading these, the frames are possibly fragmented and interleaved with control frames * the fragmented frames are not interleaved with data frames. Just control frames */ - public static readonly WebSocketFrame DefaultFrame = new WebSocketFrame(){Header = new WebsocketFrameHeader(),WebSocketPayload = new byte[0]}; + public static readonly WebSocketFrame DefaultFrame = new WebSocketFrame(){Header = new WebsocketFrameHeader(),WebSocketPayload = Array.Empty()}; public WebsocketFrameHeader Header; public byte[] WebSocketPayload; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 524a44e657..af3db8db59 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2419,7 +2419,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP packet.FolderData[0].FolderID = UUID.Zero; packet.FolderData[0].ParentID = UUID.Zero; packet.FolderData[0].Type = -1; - packet.FolderData[0].Name = new byte[0]; + packet.FolderData[0].Name = Array.Empty(); } private void AddNullItemBlockToDescendentsPacket(ref InventoryDescendentsPacket packet) @@ -3106,7 +3106,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP alertPack.AlertInfo = new AlertMessagePacket.AlertInfoBlock[1]; alertPack.AlertInfo[0] = new AlertMessagePacket.AlertInfoBlock(); alertPack.AlertInfo[0].Message = Util.StringToBytes256(info); - alertPack.AlertInfo[0].ExtraParams = new Byte[0]; + alertPack.AlertInfo[0].ExtraParams = Array.Empty(); OutPacket(alertPack, ThrottleOutPacketType.Task); } @@ -3717,7 +3717,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (land.Description != null && land.Description != String.Empty) reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length)); else - reply.Data.Desc = new Byte[0]; + reply.Data.Desc = Array.Empty(); reply.Data.ActualArea = land.Area; reply.Data.BillableArea = land.Area; // TODO: what is this? @@ -4373,7 +4373,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP gmp.MethodData.Method = Util.StringToBytes256("emptymutelist"); gmp.ParamList = new GenericMessagePacket.ParamListBlock[1]; gmp.ParamList[0] = new GenericMessagePacket.ParamListBlock(); - gmp.ParamList[0].Parameter = new byte[0]; + gmp.ParamList[0].Parameter = Array.Empty(); OutPacket(gmp, ThrottleOutPacketType.Task); } @@ -12626,7 +12626,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP int idx = cachedtex.WearableData[i].TextureIndex; cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; - cachedresp.WearableData[i].HostName = new byte[0]; + cachedresp.WearableData[i].HostName = Array.Empty(); if (cachedtex.WearableData[i].ID == cacheItems[idx].CacheId) { cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID; @@ -12645,7 +12645,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; cachedresp.WearableData[i].TextureID = UUID.Zero; - cachedresp.WearableData[i].HostName = new byte[0]; + cachedresp.WearableData[i].HostName = Array.Empty(); } } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index eedb015af1..5f18a8555a 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -247,7 +247,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction // "[ASSET XFER UPLOADER]: Requesting Xfer of asset {0}, type {1}, transfer id {2} from {3}", // m_asset.FullID, m_asset.Type, XferID, ourClient.Name); - ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); + ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, Array.Empty()); } protected void SendCompleteMessage() diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index 56123a53ef..a3e03aad04 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -322,7 +322,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public class XferDownLoad { public IClientAPI remoteClient; - public byte[] Data = new byte[0]; + public byte[] Data = Array.Empty(); public string FileName = String.Empty; public ulong XferID = 0; public bool isDeleted = false; diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index d201488fb7..8498ba4ec1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs @@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.FirstName+" "+client.LastName, destID, (byte)211, false, String.Empty, - transactionID, false, new Vector3(), new byte[0], true), + transactionID, false, new Vector3(), Array.Empty(), true), delegate(bool success) {} ); } } diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 6a7ed42d1e..6bdd2200a1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // fid is not a UUID... if (Util.ParseUniversalUserIdentifier(fid, out agentID, out string url, out string f, out string l, out string tmp)) { - if (!agentID.Equals(UUID.Zero)) + if (agentID.IsNotZero()) { m_uMan.AddUser(agentID, f, l, url); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 881215854b..4887a747e6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage uint ParentEstateID=0; Vector3 Position = Vector3.Zero; UUID RegionID = UUID.Zero ; - byte[] binaryBucket = new byte[0]; + byte[] binaryBucket = Array.Empty(); float pos_x = 0; float pos_y = 0; @@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage string requestData3 = (string)requestData["binary_bucket"]; if (string.IsNullOrEmpty(requestData3)) { - binaryBucket = new byte[0]; + binaryBucket = Array.Empty(); } else { diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs index 7a10f79c3f..cff812e613 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs @@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure client.FirstName+" "+client.LastName, targetid, (byte)InstantMessageDialog.RequestTeleport, false, message, sessionID, false, presence.AbsolutePosition, - new Byte[0], true); + Array.Empty(), true); m.RegionID = client.Scene.RegionInfo.RegionID.Guid; m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index b6987c849d..ba68f0b90a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure client.FirstName+" "+client.LastName, targetid, (byte)InstantMessageDialog.GodLikeRequestTeleport, false, message, dest, false, presence.AbsolutePosition, - new Byte[0], true); + Array.Empty(), true); } else { @@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure client.FirstName+" "+client.LastName, targetid, (byte)InstantMessageDialog.RequestTeleport, false, message, dest, false, presence.AbsolutePosition, - new Byte[0], true); + Array.Empty(), true); } if (m_TransferModule != null) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index dacb69c53f..b552186e4b 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -567,7 +567,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture if(backImage == null) { SetAlpha(ref image1, newAlpha); - byte[] result = new byte[0]; + byte[] result = Array.Empty(); try { @@ -597,7 +597,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture image1.Dispose(); image2.Dispose(); - byte[] result = new byte[0]; + byte[] result = Array.Empty(); try { diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 4f18d00107..8e131740f2 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL RequestState state = (RequestState) result.AsyncState; WebRequest request = (WebRequest) state.Request; Stream stream = null; - byte[] imageJ2000 = new byte[0]; + byte[] imageJ2000 = Array.Empty(); Size newSize = new Size(0, 0); HttpWebResponse response = null; diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 0ed094b311..839cc8ffce 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender GDIDraw(data, graph, altDataDelim, out reuseable); } - byte[] imageJ2000 = new byte[0]; + byte[] imageJ2000 = Array.Empty(); // This code exists for testing purposes, please do not remove. // if (s_flipper) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs index 9c494685b7..741fdd09f8 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs @@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.World.Estate private bool Call(GridRegion region, Dictionary sendData) { string reqString = ServerUtils.BuildQueryString(sendData); - // m_log.DebugFormat("[XESTATE CONNECTOR]: queryString = {0}", reqString); + // m_log.DebugFormat("[ESTATE CONNECTOR]: queryString = {0}", reqString); try { //string url = ""; @@ -207,11 +207,11 @@ namespace OpenSim.Region.CoreModules.World.Estate return indx > 0; } else - m_log.DebugFormat("[XESTATE CONNECTOR]: received empty reply"); + m_log.DebugFormat("[ESTATE CONNECTOR]: received empty reply"); } catch (Exception e) { - m_log.DebugFormat("[XESTATE CONNECTOR]: Exception when contacting remote sim: {0}", e.Message); + m_log.DebugFormat("[ESTATE CONNECTOR]: Exception when contacting remote sim: {0}", e.Message); } return false; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index 788cdc49ca..ecff9ddcd5 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId.ToString()) { - Data = new byte[0], + Data = Array.Empty(), Description = "empty", Local = true, Temporary = true diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index ff3e859df0..7097310970 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -232,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // this has to be called with a lock on m_scene protected virtual void AddHandlers() { - myMapImageJPEG = new byte[0]; + myMapImageJPEG = Array.Empty(); string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); regionimage = regionimage.Replace("-", ""); @@ -1576,7 +1576,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { m_scene.AssetService.Delete(lastID.ToString()); m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Zero; - myMapImageJPEG = new byte[0]; + myMapImageJPEG = Array.Empty(); needRegionSave = true; } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cac0ef78d8..4b087966d0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -730,7 +730,7 @@ namespace OpenSim.Region.Framework.Scenes if(m_particleSystemExpire > 0 && Util.GetTimeStamp() > m_particleSystemExpire) { m_particleSystemExpire = -1; - m_particleSystem = new byte[0]; + m_particleSystem = Array.Empty(); } return m_particleSystem; } @@ -1950,7 +1950,7 @@ namespace OpenSim.Region.Framework.Scenes public void RemoveParticleSystem() { - m_particleSystem = new byte[0]; + m_particleSystem = Array.Empty(); } public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 7973f165b4..74689e1a11 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -47,8 +47,8 @@ namespace OpenSim.Region.Framework.Scenes { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private byte[] m_inventoryFileData = new byte[0]; - private byte[] m_inventoryFileNameBytes = new byte[0]; + private byte[] m_inventoryFileData = Array.Empty(); + private byte[] m_inventoryFileNameBytes = Array.Empty(); private string m_inventoryFileName = ""; private uint m_inventoryFileNameSerial = 0; private bool m_inventoryPrivileged = false; @@ -1350,14 +1350,14 @@ namespace OpenSim.Region.Framework.Scenes if (m_inventorySerial == 0) // No inventory { m_items.LockItemsForRead(false); - client.SendTaskInventory(m_part.UUID, 0, new byte[0]); + client.SendTaskInventory(m_part.UUID, 0, Array.Empty()); return; } if (m_items.Count == 0) // No inventory { m_items.LockItemsForRead(false); - client.SendTaskInventory(m_part.UUID, 0, new byte[0]); + client.SendTaskInventory(m_part.UUID, 0, Array.Empty()); return; } @@ -1466,7 +1466,7 @@ namespace OpenSim.Region.Framework.Scenes return; } - client.SendTaskInventory(m_part.UUID, 0, new byte[0]); + client.SendTaskInventory(m_part.UUID, 0, Array.Empty()); } } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index b2a20946e4..03f2cd71a0 100755 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1474,7 +1474,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } public byte[] GetThrottlesPacked(float multiplier) { - return new byte[0]; + return Array.Empty(); } #pragma warning disable 0067 diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 14ab65c161..21da019fe6 100755 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -454,7 +454,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = UUID.Zero.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); OutgoingInstantMessage(msg, inviteInfo.AgentID); @@ -1222,7 +1222,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups msg.timestamp = (uint)Util.UnixTimeSinceEpoch(); msg.fromAgentName = string.Empty; msg.message = string.Empty; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); } return msg; @@ -1365,7 +1365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = regionInfo.RegionID.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); OutgoingInstantMessage(msg, ejecteeID); // Message to ejector @@ -1386,7 +1386,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups msg.ParentEstateID = 0; msg.Position = Vector3.Zero; msg.RegionID = regionInfo.RegionID.Guid; - msg.binaryBucket = new byte[0]; + msg.binaryBucket = Array.Empty(); OutgoingInstantMessage(msg, agentID); } diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index a130308d22..9e3e358e90 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -356,7 +356,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule client.SendAlertMessage(e.Message + " "); } - client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); + client.SendMoneyBalance(TransactionID, true, Array.Empty(), returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); } else { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 7d09b9cac7..e9deaf8d87 100755 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -208,7 +208,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC OnInstantMessage(this, new GridInstantMessage(m_scene, m_uuid, m_firstname + " " + m_lastname, target, 0, false, message, - UUID.Zero, false, Position, new byte[0], true)); + UUID.Zero, false, Position, Array.Empty(), true)); } public void SendAgentOffline(UUID[] agentIDs) @@ -705,7 +705,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC } public byte[] GetThrottlesPacked(float multiplier) { - return new byte[0]; + return Array.Empty(); } diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs index baf55c34af..460908c333 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs @@ -113,7 +113,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView int width, int height, bool usetex) { if (!m_Enabled) - return new Byte[0]; + return Array.Empty(); using (Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, height, usetex)) { diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index 8720cc78c5..88b5ba1489 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView m_log.Debug("[WORLDVIEW]: Exception: " + e.ToString()); } - return new Byte[0]; + return Array.Empty(); } public Byte[] SendWorldView(Dictionary request) @@ -99,25 +99,25 @@ namespace OpenSim.Region.OptionalModules.World.WorldView bool usetex; if (!request.ContainsKey("posX")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("posY")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("posZ")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("rotX")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("rotY")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("rotZ")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("fov")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("width")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("height")) - return new Byte[0]; + return Array.Empty(); if (!request.ContainsKey("usetex")) - return new Byte[0]; + return Array.Empty(); try { @@ -134,7 +134,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView } catch { - return new Byte[0]; + return Array.Empty(); } Vector3 pos = new Vector3(posX, posY, posZ); diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs index e791b27e42..3e2a82bb72 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSShapes.cs @@ -566,7 +566,7 @@ public class BSShapeMesh : BSShape if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched) { // Release the fetched asset data once it has been used. - pbs.SculptData = new byte[0]; + pbs.SculptData = Array.Empty(); prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Unknown; } @@ -816,7 +816,7 @@ public class BSShapeHull : BSShape if (prim.PrimAssetState == BSPhysObject.PrimAssetCondition.Fetched) { // Release the fetched asset data once it has been used. - pbs.SculptData = new byte[0]; + pbs.SculptData = Array.Empty(); prim.PrimAssetState = BSPhysObject.PrimAssetCondition.Unknown; } diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs index 783b3d4bab..e97df3fb89 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs @@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.Asset protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { - byte[] result = new byte[0]; + byte[] result = Array.Empty(); string[] p = SplitParams(path); @@ -88,7 +88,7 @@ namespace OpenSim.Server.Handlers.Asset { httpResponse.StatusCode = (int)HttpStatusCode.NotFound; httpResponse.ContentType = "text/plain"; - result = new byte[0]; + result = Array.Empty(); } else { @@ -112,7 +112,7 @@ namespace OpenSim.Server.Handlers.Asset { httpResponse.StatusCode = (int)HttpStatusCode.NotFound; httpResponse.ContentType = "text/plain"; - result = new byte[0]; + result = Array.Empty(); } } else @@ -120,7 +120,7 @@ namespace OpenSim.Server.Handlers.Asset // Unknown request httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; httpResponse.ContentType = "text/plain"; - result = new byte[0]; + result = Array.Empty(); } } else if (p.Length == 1) @@ -142,7 +142,7 @@ namespace OpenSim.Server.Handlers.Asset { httpResponse.StatusCode = (int)HttpStatusCode.NotFound; httpResponse.ContentType = "text/plain"; - result = new byte[0]; + result = Array.Empty(); } } else @@ -150,7 +150,7 @@ namespace OpenSim.Server.Handlers.Asset // Unknown request httpResponse.StatusCode = (int)HttpStatusCode.BadRequest; httpResponse.ContentType = "text/plain"; - result = new byte[0]; + result = Array.Empty(); } if (httpResponse.StatusCode == (int)HttpStatusCode.NotFound && !string.IsNullOrEmpty(m_RedirectURL) && !string.IsNullOrEmpty(id)) diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 4f03cf4a28..d1430a0c20 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs @@ -187,7 +187,7 @@ namespace OpenSim.Server.Handlers.Authentication private byte[] DoEncryptedMethods(byte[] ciphertext) { - return new byte[0]; + return Array.Empty(); } private byte[] SuccessResult() diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakes.cs b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs index 6876ed5d09..c0c0998554 100644 --- a/OpenSim/Server/Handlers/BakedTextures/XBakes.cs +++ b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs @@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.BakedTextures catch { } - return new byte[0]; + return Array.Empty(); } public void Store(string id, byte[] data, int dataLength) diff --git a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs index 63f376d2fc..1061a6f543 100644 --- a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs @@ -47,9 +47,7 @@ namespace OpenSim.Server.Handlers.Hypergrid { public class InstantMessageServerConnector : ServiceConnector { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IInstantMessage m_IMService; @@ -105,7 +103,7 @@ namespace OpenSim.Server.Handlers.Hypergrid uint ParentEstateID = 0; Vector3 Position = Vector3.Zero; UUID RegionID = UUID.Zero; - byte[] binaryBucket = new byte[0]; + byte[] binaryBucket = Array.Empty(); float pos_x = 0; float pos_y = 0; @@ -198,7 +196,7 @@ namespace OpenSim.Server.Handlers.Hypergrid string requestData3 = (string)requestData["binary_bucket"]; if (string.IsNullOrEmpty(requestData3)) { - binaryBucket = new byte[0]; + binaryBucket = Array.Empty(); } else { @@ -235,10 +233,7 @@ namespace OpenSim.Server.Handlers.Hypergrid // calling region uses this to know when to look up a user's location again. XmlRpcResponse resp = new XmlRpcResponse(); Hashtable respdata = new Hashtable(); - if (successful) - respdata["success"] = "TRUE"; - else - respdata["success"] = "FALSE"; + respdata["success"] = successful ? "TRUE" : "FALSE"; resp.Value = respdata; return resp; diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index 516fabfad8..d9d949e555 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs @@ -88,10 +88,10 @@ namespace OpenSim.Server.Handlers.MapImage { httpResponse.StatusCode = (int)HttpStatusCode.ServiceUnavailable; httpResponse.AddHeader("Retry-After", "10"); - return new byte[0]; + return Array.Empty(); } - byte[] result = new byte[0]; + byte[] result = Array.Empty(); string format = string.Empty; //UUID scopeID = new UUID("07f8d88e-cd5e-4239-a0ed-843f75d09992"); @@ -119,7 +119,7 @@ namespace OpenSim.Server.Handlers.MapImage { httpResponse.StatusCode = (int)HttpStatusCode.NotFound; httpResponse.ContentType = "text/plain"; - return new byte[0]; + return Array.Empty(); } result = m_MapService.GetMapTile(path, scopeID, out format); diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs index a9993bacaa..1999a21c98 100644 --- a/OpenSim/Services/FSAssetService/FSAssetService.cs +++ b/OpenSim/Services/FSAssetService/FSAssetService.cs @@ -596,7 +596,7 @@ namespace OpenSim.Services.FSAssetService } catch (Exception) { - return new Byte[0]; + return Array.Empty(); } } else if (File.Exists(diskFile)) @@ -611,7 +611,7 @@ namespace OpenSim.Services.FSAssetService { } } - return new Byte[0]; + return Array.Empty(); } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 89e1fedefd..f7a611754b 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -256,7 +256,7 @@ namespace OpenSim.Services.MapImageService else { //m_log.DebugFormat("[MAP IMAGE SERVICE]: unable to get file {0}", fileName); - return new byte[0]; + return Array.Empty(); } } } diff --git a/OpenSim/Services/MuteListService/MuteListService.cs b/OpenSim/Services/MuteListService/MuteListService.cs index 52db8a4301..9191db2672 100644 --- a/OpenSim/Services/MuteListService/MuteListService.cs +++ b/OpenSim/Services/MuteListService/MuteListService.cs @@ -84,7 +84,7 @@ namespace OpenSim.Services.EstateService MuteData[] data = m_database.Get(agentID); if (data == null || data.Length == 0) - return new Byte[0]; + return Array.Empty(); StringBuilder sb = new StringBuilder(16384); foreach (MuteData d in data) @@ -101,7 +101,7 @@ namespace OpenSim.Services.EstateService if (dataCrc == crc) { if(crc == 0) - return new Byte[0]; + return Array.Empty(); Byte[] ret = new Byte[1] {1}; return ret; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index a2338b2893..80f8a814d7 100755 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -619,7 +619,7 @@ namespace OpenSim.Tests.Common public byte[] GetThrottlesPacked(float multiplier) { - return new byte[0]; + return Array.Empty(); } public virtual void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 4a7204c52a..2cf8cf6b12 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -221,7 +221,7 @@ namespace OpenSim.Tests.Common public byte[] EndEventToBytes(osUTF8 sb) { - return new byte[0]; + return Array.Empty(); } } } \ No newline at end of file