adamdebreceni commented on a change in pull request #1192:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1192#discussion_r722062783
##########
File path: libminifi/include/core/ClassLoader.h
##########
@@ -93,18 +94,18 @@ class ClassLoader {
std::vector<std::string> getClasses(const std::string &group) const {
std::lock_guard<std::mutex> lock(internal_mutex_);
- std::vector<std::string> classes;
+ std::vector<std::string> class_names;
for (const auto& child_loader : class_loaders_) {
for (auto&& clazz : child_loader.second.getClasses(group)) {
- classes.push_back(std::move(clazz));
+ class_names.push_back(std::move(clazz));
}
}
for (const auto& factory : loaded_factories_) {
if (factory.second->getGroupName() == group) {
- classes.push_back(factory.second->getClassName());
+ class_names.push_back(factory.second->getClassName());
}
}
- return classes;
+ return std::move(class_names) | ranges::actions::sort |
ranges::actions::unique;
Review comment:
I think we should move this to the source file (and its dependency on
ranges) as many source files include ClassLoader.h transitively through
Resource.h
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]