diff options
author | Brice Videau <bvideau@anl.gov> | 2022-04-12 21:56:24 -0500 |
---|---|---|
committer | Brice Videau <bvideau@anl.gov> | 2022-04-12 22:20:43 -0500 |
commit | bdb4edeae927b1bf4d867175c21d110c17812fbd (patch) | |
tree | 03d3170b06553596ecf0be48593b09bc9d563225 /lib/ffi | |
parent | edbee9ded2bfdb3de19d46137ffe6e2b85f5d350 (diff) | |
download | ffi-bdb4edeae927b1bf4d867175c21d110c17812fbd.tar.gz |
Remove unneeded affectations.
Diffstat (limited to 'lib/ffi')
-rw-r--r-- | lib/ffi/enum.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ffi/enum.rb b/lib/ffi/enum.rb index a3e4465..903525e 100644 --- a/lib/ffi/enum.rb +++ b/lib/ffi/enum.rb @@ -240,7 +240,7 @@ module FFI when Symbol flat_query.inject(0) do |val, o| v = @kv_map[o] - if v then val |= v else val end + if v then val | v else val end end when Integer, ->(o) { o.respond_to?(:to_int) } val = flat_query.inject(0) { |mask, o| mask |= o.to_int } @@ -265,11 +265,11 @@ module FFI when Symbol v = @kv_map[o] raise ArgumentError, "invalid bitmask value, #{o.inspect}" unless v - val |= v + val | v when Integer - val |= o + val | o when ->(obj) { obj.respond_to?(:to_int) } - val |= o.to_int + val | o.to_int else raise ArgumentError, "invalid bitmask value, #{o.inspect}" end |