Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / PoolItemBest.cc
index 4049f64..d6e4062 100644 (file)
@@ -28,12 +28,7 @@ namespace zypp
   /** PoolItemBest implementation. */
   struct PoolItemBest::Impl
   {
-    Impl( bool preferNotLocked_r )
-    : _preferNotLocked { preferNotLocked_r }
-    {}
-
     Container _container;
-    bool _preferNotLocked;
 
     private:
       friend Impl * rwcowClone<Impl>( const Impl * rhs );
@@ -49,11 +44,8 @@ namespace zypp
   //
   ///////////////////////////////////////////////////////////////////
 
-  void PoolItemBest::_ctor_init( bool preferNotLocked_r )
-  { _dont_use_this_use_pimpl.reset( new RWCOW_pointer<Impl>(new Impl( preferNotLocked_r )) ); }
-
   void PoolItemBest::_ctor_init()
-  { _ctor_init( /*preferNotLocked*/false ); }
+  { _dont_use_this_use_pimpl.reset( new RWCOW_pointer<Impl>(new Impl) ); }
 
   const PoolItemBest::Container & PoolItemBest::container() const
   { return pimpl()->_container; }
@@ -61,24 +53,8 @@ namespace zypp
   void PoolItemBest::add( const PoolItem & pi_r )
   {
     Container & container( pimpl()->_container );
-
     PoolItem & ccand( container[pi_r.satSolvable().ident()] );
-    if ( ! ccand )
-      ccand = pi_r;
-    else if ( pimpl()->_preferNotLocked )
-    {
-      if ( ! pi_r.status().isLocked() )
-      {
-       if ( ccand.status().isLocked() || ui::SelectableTraits::AVOrder()( pi_r, ccand ) )
-         ccand = pi_r;
-      }
-      else if ( ccand.status().isLocked() )
-      {
-       if ( ui::SelectableTraits::AVOrder()( pi_r, ccand ) )
-         ccand = pi_r;
-      }
-    }
-    else if ( ui::SelectableTraits::AVOrder()( pi_r, ccand ) )
+    if ( ! ccand || ui::SelectableTraits::AVOrder()( pi_r, ccand ) )
       ccand = pi_r;
   }