8000 Minor geo issues by graetzer · Pull Request #6471 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Minor geo issues #6471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
minor issues
  • Loading branch information
graetzer committed Sep 12, 2018
commit 759d4d8f79357bd4100b38e990f00a26b848fdd3
8 changes: 5 additions & 3 deletions arangod/GeoIndex/Near.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ class NearUtils {

public:
/// @brief get cell covering target coordinate (at max level)
S2Point origin() const { return _origin; }
inline S2Point origin() const { return _origin; }

geo::FilterType filterType() const { return _params.filterType; }
inline geo::FilterType filterType() const { return _params.filterType; }

geo::ShapeContainer const& filterShape() const { return _params.filterShape; }
inline geo::ShapeContainer const& filterShape() const {
return _params.filterShape;
}

/// @brief all intervals are covered, no more buffered results
bool isDone() const {
Expand Down
6 changes: 3 additions & 3 deletions arangod/MMFiles/MMFilesGeoIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ struct NearIterator final : public IndexIterator {
char const* typeName() const override { return "s2-index-iterator"; }

/// internal retrieval loop
inline bool nextToken(
std::function<bool(geo_index::Document const& gdoc)>&& cb, size_t limit) {
template<typename F>
inline bool nextToken(F&& cb, size_t limit) {
if (_near.isDone()) {
// we already know that no further results will be returned by the index
TRI_ASSERT(!_near.hasNearest());
Expand All @@ -71,7 +71,7 @@ struct NearIterator final : public IndexIterator {

while (limit > 0 && !_near.isDone()) {
while (limit > 0 && _near.hasNearest()) {
if (cb(_near.nearest())) {
if (std::forward<F>(cb)(_near.nearest())) {
limit--;
}
_near.popNearest();
Expand Down
10 changes: 5 additions & 5 deletions arangod/RocksDBEngine/RocksDBGeoIndex.cpp
55E7
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class RDBNearIterator final : public IndexIterator {
}

/// internal retrieval loop
template<typename T>
inline bool nextToken(T cb, size_t limit) {
template<typename F>
inline bool nextToken(F&& cb, size_t limit) {
if (_near.isDone()) {
// we already know that no further results will be returned by the index
TRI_ASSERT(!_near.hasNearest());
Expand All @@ -79,7 +79,7 @@ class RDBNearIterator final : public IndexIterator {

while (limit > 0 && !_near.isDone()) {
while (limit > 0 && _near.hasNearest()) {
if (cb(_near.nearest())) {
if (std::forward<F>(cb)(_near.nearest())) {
limit--;
}
_near.popNearest();
Expand Down Expand Up @@ -113,10 +113,10 @@ class RDBNearIterator final : public IndexIterator {
return;
}
}
cb(gdoc.token, doc); // return result
cb(gdoc.token, doc); // return document
result = true;
})) {
return false;
return false; // ignore document
}
return result;
},
Expand Down
0