Revert "In GridService, have GetRegionByName() call GetRegionsByName() with a max return of 1 instead of duplicating code."

This reverts commit 8d33a2eaa1.

Better fix will be along in a minute
bulletsim
Justin Clark-Casey (justincc) 2011-08-02 00:40:23 +01:00
parent 8d33a2eaa1
commit e6fb9d74ef
1 changed files with 4 additions and 5 deletions

View File

@ -322,17 +322,16 @@ namespace OpenSim.Services.GridService
public GridRegion GetRegionByName(UUID scopeID, string regionName) public GridRegion GetRegionByName(UUID scopeID, string regionName)
{ {
List<GridRegion> rinfos = GetRegionsByName(scopeID, regionName, 1); List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID);
if ((rdatas != null) && (rdatas.Count > 0))
if (rinfos.Count > 0) return RegionData2RegionInfo(rdatas[0]); // get the first
return rinfos[0];
return null; return null;
} }
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
{ {
// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);