From 298bc93954e32180744d5aa270795cf1cc4651fc Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Fri, 15 Jul 2016 12:28:10 -0700 Subject: [PATCH] osd: use static method and simplify return Signed-off-by: Noah Watkins --- src/osd/ClassHandler.cc | 5 +---- src/osd/ClassHandler.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/osd/ClassHandler.cc b/src/osd/ClassHandler.cc index 46ba48d19e6..25d1565a139 100644 --- a/src/osd/ClassHandler.cc +++ b/src/osd/ClassHandler.cc @@ -102,10 +102,7 @@ bool ClassHandler::in_class_list(const std::string& cname, auto it = std::find_first_of(begin, end, targets.begin(), targets.end()); - if (it == end) - return false; - - return true; + return it != end; } ClassHandler::ClassData *ClassHandler::_get_class(const string& cname, diff --git a/src/osd/ClassHandler.h b/src/osd/ClassHandler.h index f0e09422fce..3cca309a12c 100644 --- a/src/osd/ClassHandler.h +++ b/src/osd/ClassHandler.h @@ -106,7 +106,7 @@ private: ClassData *_get_class(const string& cname, bool check_allowed); int _load_class(ClassData *cls); - bool in_class_list(const std::string& cname, + static bool in_class_list(const std::string& cname, const std::string& list); public: -- 2.47.3