diff options
author | Justin Clark-Casey (justincc) | 2012-04-30 16:00:31 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-30 16:00:31 +0100 |
commit | 4ad45934c67f221fa54e1c7407949b375956eed6 (patch) | |
tree | a192e3cbc02e1bdcfd353ebf9a88bd93406fe706 /OpenSim/Data | |
parent | Consistently use using() to make sure we dispose of used MySqlCommands where ... (diff) | |
download | opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.zip opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.gz opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.bz2 opensim-SC_OLD-4ad45934c67f221fa54e1c7407949b375956eed6.tar.xz |
If there are no new prim items to store then don't bother opening the MySqlConnection only to do nothing with it.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 6 |
1 files changed, 3 insertions, 3 deletions
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 | |||
1800 | { | 1800 | { |
1801 | RemoveItems(primID); | 1801 | RemoveItems(primID); |
1802 | 1802 | ||
1803 | if (items.Count == 0) | ||
1804 | return; | ||
1805 | |||
1803 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 1806 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
1804 | { | 1807 | { |
1805 | dbcon.Open(); | 1808 | dbcon.Open(); |
1806 | 1809 | ||
1807 | using (MySqlCommand cmd = dbcon.CreateCommand()) | 1810 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
1808 | { | 1811 | { |
1809 | if (items.Count == 0) | ||
1810 | return; | ||
1811 | |||
1812 | cmd.CommandText = "insert into primitems (" + | 1812 | cmd.CommandText = "insert into primitems (" + |
1813 | "invType, assetType, name, " + | 1813 | "invType, assetType, name, " + |
1814 | "description, creationDate, nextPermissions, " + | 1814 | "description, creationDate, nextPermissions, " + |