Commit 2a8777d3 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Optimization: Do not execute a db query if the property to remove does not exist.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1061 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4acf9ad3
...@@ -213,8 +213,10 @@ public class User implements Cacheable { ...@@ -213,8 +213,10 @@ public class User implements Cacheable {
if (properties == null) { if (properties == null) {
loadPropertiesFromDb(); loadPropertiesFromDb();
} }
properties.remove(name); if (properties.remove(name) != null) {
deletePropertyFromDb(name); // Only delete the propery from the DB if it was removed from memory
deletePropertyFromDb(name);
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment