aboutsummaryrefslogtreecommitdiffstats
path: root/src/algo_factory
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-12-25 22:15:32 +0000
committerlloyd <[email protected]>2013-12-25 22:15:32 +0000
commite4987a3b83a6ae95fee839ab84c70f1f1da2bc88 (patch)
tree2947466e739f10ddba30a85a6db11cb62941acf6 /src/algo_factory
parente72c0d999d0784ce2610e4bed471f4483da72943 (diff)
Move add_alias and deref_alias from Library_State to SCAN_Name
Diffstat (limited to 'src/algo_factory')
-rw-r--r--src/algo_factory/algo_cache.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/algo_factory/algo_cache.h b/src/algo_factory/algo_cache.h
index 11a5580fb..3bd9f0031 100644
--- a/src/algo_factory/algo_cache.h
+++ b/src/algo_factory/algo_cache.h
@@ -131,13 +131,12 @@ const T* Algorithm_Cache<T>::get(const std::string& algo_spec,
for(auto i = algo->second.begin(); i != algo->second.end(); ++i)
{
- const std::string prov_name = i->first;
- const size_t prov_weight = static_provider_weight(prov_name);
-
// preferred prov exists, return immediately
- if(prov_name == pref_provider)
+ if(i->first == pref_provider)
return i->second;
+ const size_t prov_weight = static_provider_weight(i->first);
+
if(prototype == nullptr || prov_weight > prototype_prov_weight)
{
prototype = i->second;