Skip to content

Commit

Permalink
Avoid branching in unsafe_bitsetindex!
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobaldassi committed Nov 12, 2015
1 parent d7cd023 commit 6ebc60d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,8 @@ end
i1, i2 = get_chunks_id(i)
u = UInt64(1) << i2
@inbounds begin
if x
Bc[i1] |= u
else
Bc[i1] &= ~u
end
c = Bc[i1]
Bc[i1] = ifelse(x, c | u, c & ~u)
end
end

Expand Down

0 comments on commit 6ebc60d

Please sign in to comment.