summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrice Videau <bvideau@anl.gov>2022-04-12 21:56:24 -0500
committerBrice Videau <bvideau@anl.gov>2022-04-12 22:20:43 -0500
commitbdb4edeae927b1bf4d867175c21d110c17812fbd (patch)
tree03d3170b06553596ecf0be48593b09bc9d563225
parentedbee9ded2bfdb3de19d46137ffe6e2b85f5d350 (diff)
downloadffi-bdb4edeae927b1bf4d867175c21d110c17812fbd.tar.gz
Remove unneeded affectations.
-rw-r--r--lib/ffi/enum.rb8
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