Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] <rest-service> master : patches module: code review
  • From: Bjoern Geuken <bgeuken@xxxxxxx>
  • Date: Tue, 1 Sep 2009 15:28:28 +0200
  • Message-id: <E1MiTnU-0006Se-N8@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit a7c8610daf8fd19ddafb63a24ec9875047d05ba0
Author: Bjoern Geuken <bgeuken@xxxxxxx>
Date: Tue Sep 1 15:28:28 2009 +0200

patches module: code review
---
.../patches/app/controllers/packages_controller.rb | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/plugins/patches/app/controllers/packages_controller.rb
b/plugins/patches/app/controllers/packages_controller.rb
index 38d8bfd..a9d8162 100644
--- a/plugins/patches/app/controllers/packages_controller.rb
+++ b/plugins/patches/app/controllers/packages_controller.rb
@@ -44,21 +44,11 @@ class PackagesController < ApplicationController
package_list = ["3ddiag", "foo", "yast2-users", "yast2-network"]

package_list.each {|pk_name|
- p = nil
- for i in 0..packages.size-1
- # package installed?
- if pk_name == packages[i].name
- # store package
- p = packages[i]
- break
- end
- end
- if p
- vendor_packages << p
- else
- vendor_packages << Package.new(:resolvable_id => 0, :name => pk_name,
:version => "not_installed")
- end
+ p = packages.find { |pkg| pk_name == pkg.name }
+ p ||= Package.new(:resolvable_id => 0, :name => pk_name, :version =>
"not_installed")
+ vendor_packages << p
}
+
vendor_packages
end

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages