X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2ef6a960d13bbcbd8be6d7b73ed41a29ac67ed52..8fe18995964717ff6f88858291c6f464cc40397f:/lib/potlatch.rb diff --git a/lib/potlatch.rb b/lib/potlatch.rb index a077d4c4d..6e8c88bb8 100644 --- a/lib/potlatch.rb +++ b/lib/potlatch.rb @@ -30,9 +30,7 @@ module Potlatch # Return numeric array def self.getarray(s) - getlong(s).times.collect do - getvalue(s) - end + Array.new(getlong(s)) { getvalue(s) } end # Return object/hash @@ -251,11 +249,11 @@ module Potlatch tag = $1 type = $2 values = $3 - if values == "-" - autotags[type][tag] = [] - else - autotags[type][tag] = values.split(",").sort.reverse - end + autotags[type][tag] = if values == "-" + [] + else + values.split(",").sort.reverse + end end end