[ 
https://issues.apache.org/jira/browse/ARROW-15220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antoine Pitrou resolved ARROW-15220.
------------------------------------
    Resolution: Fixed

Issue resolved by pull request 12052
[https://github.com/apache/arrow/pull/12052]

> [C++] Remove bool specializations of bit block counter operations
> -----------------------------------------------------------------
>
>                 Key: ARROW-15220
>                 URL: https://issues.apache.org/jira/browse/ARROW-15220
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Eduardo Ponce
>            Assignee: Eduardo Ponce
>            Priority: Minor
>              Labels: good-first-issue, pull-request-available
>             Fix For: 7.0.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> We can simplify the [logical bit operations in 
> util/bit_block_counter.h|https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/bit_block_counter.h#L53]
>  so that the specializations for {{bool}} and {{T}} can be merged because C++ 
> guarantees that for boolean types: {{(bool)(a & b) == a && b}}. Note the 
> explicit cast which corresponds to the return type {{T}} in these functions.
> {code}
> // Works correctly for bool and integer types
> template <typename T>
> T bit_and(T x, T y) {
>   return x & y;
> }
> {code}
> This change has a higher impact for ternary bitwise versions, see for example 
> [here|https://github.com/apache/arrow/pull/11882/files#diff-fd2cb2745dc0cc2a84f7cd46cba410ef26f48abaf80e0fe3cc6c8657ab42a743R93]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to