[ 
https://issues.apache.org/jira/browse/ARROW-3377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16633838#comment-16633838
 ] 

Wes McKinney commented on ARROW-3377:
-------------------------------------

I twiddled with this in the past but was having a hard time avoiding a compiler 
warning on all platforms, that's the only reason there is a branch now

> [C++] Remove If statement from bit map set function
> ---------------------------------------------------
>
>                 Key: ARROW-3377
>                 URL: https://issues.apache.org/jira/browse/ARROW-3377
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++, Gandiva
>            Reporter: Praveen Krishna
>            Priority: Major
>             Fix For: 0.12.0
>
>
> Hello,
> For setting a bit in bit map (which is used in gandiva) we have a branch 
> statement which can be replaced by bit operations like this
> {code:java}
> bmap[byteIdx] ^= (-value ^ bmap[byteIdx]) & (1UL << bitIdx);
> {code}
>  which performs the same operation and we have avoid the branching.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to