Mailinglist Archive: zypp-devel (148 mails)

< Previous Next >
Re: [zypp-devel] New resolvable state : recommended/suggested
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Fri, 28 Mar 2008 10:38:29 +0100
  • Message-id: <20080328093829.GA26375@xxxxxxxxxxxxx>
* Duncan Mac-Vicar P. <dmacvicar@xxxxxxx> [Mar 28. 2008 10:22]:

Pool.each do s
if s.isToBeInstalled do foo
if s.isToBeDeleted do bar
end

to

Pool.each_to_install do s
do foo
end
Pool.each_to_delete do s
do bar
end

If you see, it is only syntax sugar.

Well, it _looks_ like more than this.

Pool.each do s
if s.isToBeInstalled

implies that we're looping over a lot of pool items with status just to
pick up those few selected for installation.

While

Pool.each_to_install do s

implies that Pool is a handle to the current transaction and
each_to_install is a filter on this transaction.


To me, the latter is a better architectural model.


Klaus
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >