From 0619477238441aba76740debb1b1d79164aad140 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 19 Sep 2013 20:24:59 -0700 Subject: [PATCH] optimize rule::active which is called in loop in feature_style_processor_impl --- include/mapnik/rule.hpp | 5 ++++- src/rule.cpp | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/mapnik/rule.hpp b/include/mapnik/rule.hpp index 3cebca33c..a0e1cca4c 100644 --- a/include/mapnik/rule.hpp +++ b/include/mapnik/rule.hpp @@ -168,7 +168,10 @@ public: bool has_else_filter() const; void set_also(bool also_filter); bool has_also_filter() const; - bool active(double scale) const; + inline bool active(double scale) const + { + return ( scale >= min_scale_ - 1e-6 && scale < max_scale_ + 1e-6 && !syms_.empty()); + } private: diff --git a/src/rule.cpp b/src/rule.cpp index 32ba4d694..318feb205 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -266,9 +266,4 @@ bool rule::has_also_filter() const return also_filter_; } -bool rule::active(double scale) const -{ - return ( !syms_.empty() && scale >= min_scale_ - 1e-6 && scale < max_scale_ + 1e-6); -} - }