refactor: In UserProfileModule, change classifiedCache and classifiedInterest to m_classifiedCache and m_classifiedInterest
This is the coding standard name style for private fields.cpu-performance
parent
ecfc6a3f4a
commit
9c530d725f
|
@ -60,8 +60,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
// The pair of Dictionaries are used to handle the switching of classified ads
|
// The pair of Dictionaries are used to handle the switching of classified ads
|
||||||
// by maintaining a cache of classified id to creator id mappings and an interest
|
// by maintaining a cache of classified id to creator id mappings and an interest
|
||||||
// count. The entries are removed when the interest count reaches 0.
|
// count. The entries are removed when the interest count reaches 0.
|
||||||
Dictionary<UUID,UUID> classifiedCache = new Dictionary<UUID, UUID>();
|
Dictionary<UUID,UUID> m_classifiedCache = new Dictionary<UUID, UUID>();
|
||||||
Dictionary<UUID,int> classifiedInterest = new Dictionary<UUID, int>();
|
Dictionary<UUID,int> m_classifiedInterest = new Dictionary<UUID, int>();
|
||||||
|
|
||||||
public Scene Scene
|
public Scene Scene
|
||||||
{
|
{
|
||||||
|
@ -331,16 +331,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
|
|
||||||
classifieds[cid] = name;
|
classifieds[cid] = name;
|
||||||
|
|
||||||
if(!classifiedCache.ContainsKey(cid))
|
lock(m_classifiedCache)
|
||||||
{
|
{
|
||||||
lock(classifiedCache)
|
if (!m_classifiedCache.ContainsKey(cid))
|
||||||
classifiedCache.Add(cid,creatorId);
|
{
|
||||||
lock(classifiedInterest)
|
m_classifiedCache.Add(cid,creatorId);
|
||||||
classifiedInterest.Add(cid, 0);
|
|
||||||
|
lock(m_classifiedInterest)
|
||||||
|
m_classifiedInterest.Add(cid, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lock(classifiedInterest)
|
lock(m_classifiedInterest)
|
||||||
classifiedInterest[cid] ++;
|
m_classifiedInterest[cid]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds);
|
remoteClient.SendAvatarClassifiedReply(new UUID(args[0]), classifieds);
|
||||||
|
@ -352,19 +355,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||||
UserClassifiedAdd ad = new UserClassifiedAdd();
|
UserClassifiedAdd ad = new UserClassifiedAdd();
|
||||||
ad.ClassifiedId = queryClassifiedID;
|
ad.ClassifiedId = queryClassifiedID;
|
||||||
|
|
||||||
if(classifiedCache.ContainsKey(queryClassifiedID))
|
lock (classifie
|
||||||
|
if (m_classifiedCache.ContainsKey(queryClassifiedID))
|
||||||
{
|
{
|
||||||
target = classifiedCache[queryClassifiedID];
|
target = m_classifiedCache[queryClassifiedID];
|
||||||
|
|
||||||
lock(classifiedInterest)
|
lock(m_classifiedInterest)
|
||||||
classifiedInterest[queryClassifiedID] --;
|
m_classifiedInterest[queryClassifiedID] --;
|
||||||
|
|
||||||
if(classifiedInterest[queryClassifiedID] == 0)
|
if(m_classifiedInterest[queryClassifiedID] == 0)
|
||||||
{
|
{
|
||||||
lock(classifiedInterest)
|
lock(m_classifiedInterest)
|
||||||
classifiedInterest.Remove(queryClassifiedID);
|
m_classifiedInterest.Remove(queryClassifiedID);
|
||||||
lock(classifiedCache)
|
lock(m_classifiedCache)
|
||||||
classifiedCache.Remove(queryClassifiedID);
|
m_classifiedCache.Remove(queryClassifiedID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue