X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c9d35839befe92d916425baa4daec7dd77ade929..c55169659ccab3fdb4aea11b5bea6ad62b6d297d:/app/controllers/swf_controller.rb?ds=inline diff --git a/app/controllers/swf_controller.rb b/app/controllers/swf_controller.rb index ceaf7e4c0..282f61613 100644 --- a/app/controllers/swf_controller.rb +++ b/app/controllers/swf_controller.rb @@ -161,10 +161,10 @@ class SwfController < ApplicationController def swf_record(id, r) if r.length > 62 # Long header: tag id, 0x3F, length - return pack_u16((id << 6) + 0x3F) + pack_u32(r.length) + r + pack_u16((id << 6) + 0x3F) + pack_u32(r.length) + r else # Short header: tag id, length - return pack_u16((id << 6) + r.length) + r + pack_u16((id << 6) + r.length) + r end end @@ -195,7 +195,7 @@ class SwfController < ApplicationController # Find number of bits required to store arbitrary-length binary def length_sb(n) - Math.frexp(n + (n == 0 ? 1 : 0))[1] + 1 + Math.frexp(n + (n.zero? ? 1 : 0))[1] + 1 end # ====================================================================