change getService method to provide copy and not const reference
authorJosef Reidinger <jreidinger@suse.cz>
Fri, 20 Jun 2008 14:22:42 +0000 (14:22 +0000)
committerJosef Reidinger <jreidinger@suse.cz>
Fri, 20 Jun 2008 14:22:42 +0000 (14:22 +0000)
zypp/RepoManager.cc
zypp/RepoManager.h

index 641ab01..7267190 100644 (file)
@@ -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;
index 2da84e8..b9a18fc 100644 (file)
@@ -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();