From c1117a4d33cf9fb7db9c5dbbc9172bce6b13bf77 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 29 Oct 2024 09:52:35 +0000 Subject: [PATCH] Empty featureset instead of invalid + `bool is_empty(featureset_ptr)` --- include/mapnik/featureset.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mapnik/featureset.hpp b/include/mapnik/featureset.hpp index e300ff120..1ca576034 100644 --- a/include/mapnik/featureset.hpp +++ b/include/mapnik/featureset.hpp @@ -41,21 +41,21 @@ struct MAPNIK_DECL Featureset : private util::noncopyable virtual ~Featureset() {} }; -struct MAPNIK_DECL invalid_featureset : Featureset +struct MAPNIK_DECL empty_featureset : Featureset { feature_ptr next() { return feature_ptr(); } }; using featureset_ptr = std::shared_ptr; -inline featureset_ptr make_invalid_featureset() +inline featureset_ptr make_empty_featureset() { - return std::make_shared(); + return std::make_shared(); } -inline bool is_valid(featureset_ptr const& ptr) +inline bool is_empty(featureset_ptr const& ptr) { - return (dynamic_cast(ptr.get()) == nullptr) ? true : false; + return (dynamic_cast(ptr.get()) != nullptr) ? true : false; } } // namespace mapnik