You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "asmirnov82 (via GitHub)" <gi...@apache.org> on 2023/04/05 13:21:48 UTC

[GitHub] [arrow] asmirnov82 commented on a diff in pull request #13810: ARROW-17330: [C#] Extend ArrowBuffer.BitmapBuilder to improve performance of array concatenation

asmirnov82 commented on code in PR #13810:
URL: https://github.com/apache/arrow/pull/13810#discussion_r1158512721


##########
csharp/src/Apache.Arrow/ArrowBuffer.BitmapBuilder.cs:
##########
@@ -89,6 +89,37 @@ public BitmapBuilder Append(bool value)
                 return this;
             }
 
+            /// <summary>
+            /// Append a span of bits.
+            /// </summary>
+            /// <param name="source">Source of bit span.</param>
+            /// <param name="validBits">Number of valid bits in the bit span</param>
+            /// <returns>Returns the builder (for fluent-style composition).</returns>
+            public BitmapBuilder Append(ReadOnlySpan<byte> source, int validBits)
+            {
+                var length = source.IsEmpty ? validBits : Math.Min(source.Length * 8, validBits);

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org