diff options
author | Marck | 2010-11-01 13:07:24 +0100 |
---|---|---|
committer | Diva Canto | 2010-11-01 08:01:31 -0700 |
commit | 2bce1716afb4df36c4c67b2f17f6f0f18b341987 (patch) | |
tree | c830d6ba1cf83ec0ef003179e1dccc23ed5c6c5f | |
parent | Removed a couple of very verbose debug messages. (diff) | |
download | opensim-SC-2bce1716afb4df36c4c67b2f17f6f0f18b341987.zip opensim-SC-2bce1716afb4df36c4c67b2f17f6f0f18b341987.tar.gz opensim-SC-2bce1716afb4df36c4c67b2f17f6f0f18b341987.tar.bz2 opensim-SC-2bce1716afb4df36c4c67b2f17f6f0f18b341987.tar.xz |
Fix HypergridLinker.Check4096()
Make the optimization with IEnumerable.Except() in Check4096 actually work by providing an appropriate equality definition for GridRegion objects.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 77230a3..ee06225 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -97,7 +97,7 @@ namespace OpenSim.Services.Interfaces | |||
97 | int GetRegionFlags(UUID scopeID, UUID regionID); | 97 | int GetRegionFlags(UUID scopeID, UUID regionID); |
98 | } | 98 | } |
99 | 99 | ||
100 | public class GridRegion | 100 | public class GridRegion : Object |
101 | { | 101 | { |
102 | 102 | ||
103 | /// <summary> | 103 | /// <summary> |
@@ -225,6 +225,33 @@ namespace OpenSim.Services.Interfaces | |||
225 | EstateOwner = ConvertFrom.EstateOwner; | 225 | EstateOwner = ConvertFrom.EstateOwner; |
226 | } | 226 | } |
227 | 227 | ||
228 | # region Definition of equality | ||
229 | |||
230 | /// <summary> | ||
231 | /// Define equality as two regions having the same, non-zero UUID. | ||
232 | /// </summary> | ||
233 | public bool Equals(GridRegion region) | ||
234 | { | ||
235 | if ((object)region == null) | ||
236 | return false; | ||
237 | // Return true if the non-zero UUIDs are equal: | ||
238 | return (RegionID != UUID.Zero) && RegionID.Equals(region.RegionID); | ||
239 | } | ||
240 | |||
241 | public override bool Equals(Object obj) | ||
242 | { | ||
243 | if (obj == null) | ||
244 | return false; | ||
245 | return Equals(obj as GridRegion); | ||
246 | } | ||
247 | |||
248 | public override int GetHashCode() | ||
249 | { | ||
250 | return RegionID.GetHashCode() ^ TerrainImage.GetHashCode(); | ||
251 | } | ||
252 | |||
253 | #endregion | ||
254 | |||
228 | /// <value> | 255 | /// <value> |
229 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. | 256 | /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. |
230 | /// | 257 | /// |