From 4ad45934c67f221fa54e1c7407949b375956eed6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 30 Apr 2012 16:00:31 +0100 Subject: If there are no new prim items to store then don't bother opening the MySqlConnection only to do nothing with it. --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index b36ff5a..b2a1481 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1800,15 +1800,15 @@ namespace OpenSim.Data.MySQL { RemoveItems(primID); + if (items.Count == 0) + return; + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { dbcon.Open(); using (MySqlCommand cmd = dbcon.CreateCommand()) { - if (items.Count == 0) - return; - cmd.CommandText = "insert into primitems (" + "invType, assetType, name, " + "description, creationDate, nextPermissions, " + -- cgit v1.1