From 945f7468b1bfbe6c1ab1b7e18923a75dc584fa82 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Fri, 20 Jun 2008 14:22:42 +0000 Subject: [PATCH] change getService method to provide copy and not const reference --- zypp/RepoManager.cc | 5 +---- zypp/RepoManager.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 641ab01..7267190 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -1416,11 +1416,8 @@ namespace zypp MIL << "done" << endl; } - const Service& RepoManager::getService( const std::string& name ) const + Service RepoManager::getService( const std::string& name ) const { - //little trick for Set, because it is sorted by Service name - Service tmpServ(name); - ServiceConstIterator it = _pimpl->services.find(name); if ( it == serviceEnd() ) return Service::noService; diff --git a/zypp/RepoManager.h b/zypp/RepoManager.h index 2da84e8..b9a18fc 100644 --- a/zypp/RepoManager.h +++ b/zypp/RepoManager.h @@ -457,7 +457,7 @@ namespace zypp ServiceConstIterator serviceEnd() const; - const Service& getService( const std::string& name ) const; + Service getService( const std::string& name ) const; void refreshServices(); -- 2.7.4