From 6e9d71342a1d8d928d88bb3dfd1575a0dcf1e44a Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 30 Oct 2015 00:52:45 -0400 Subject: Sort AreaStore header --- src/util/areastore.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/util/areastore.cpp') diff --git a/src/util/areastore.cpp b/src/util/areastore.cpp index 568492383..fdd4d7b79 100644 --- a/src/util/areastore.cpp +++ b/src/util/areastore.cpp @@ -54,19 +54,12 @@ AreaStore *AreaStore::getOptimalImplementation() #endif } -u16 AreaStore::size() const -{ - return areas_map.size(); -} - const Area *AreaStore::getArea(u32 id) const { - const Area *res = NULL; - std::map::const_iterator itr = areas_map.find(id); - if (itr != areas_map.end()) { - res = &itr->second; - } - return res; + AreaMap::const_iterator it = areas_map.find(id); + if (it == areas_map.end()) + return NULL; + return &it->second; } #if 0 @@ -234,7 +227,7 @@ void VectorAreaStore::getAreasInArea(std::vector *result, } #if 0 -bool SimpleAreaStore::forEach(bool (*callback)(void *args, Area *a), void *args) const +bool SimpleAreaStore::forEach(ForEachCallback callback, void *arg) const { for (size_t i = 0; i < m_areas.size(); ++i) { if (callback(m_areas[i], arg)) { @@ -308,7 +301,7 @@ void SpatialAreaStore::getAreasInArea(std::vector *result, } #if 0 -bool SpatialAreaStore::forEach(bool (*callback)(void *args, Area *a), void *args) const +bool SpatialAreaStore::forEach(ForEachCallback callback, void *arg) const { // TODO ?? (this is only needed for serialisation, but libspatial has its own serialisation) return false; -- cgit v1.2.3