edponce commented on a change in pull request #10855:
URL: https://github.com/apache/arrow/pull/10855#discussion_r682002907
##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -318,6 +373,26 @@ struct UTF8LowerTransform : public CaseMappingTransform {
template <typename Type>
using UTF8Lower = StringTransformExec<Type,
StringTransformCodepoint<UTF8LowerTransform>>;
+struct UTF8SwapCaseTransform : public CaseMappingTransform {
+ static uint32_t TransformCodepoint(uint32_t codepoint) {
+ if (codepoint <= kMaxCodepointLookup) {
+ return lut_swapcase_codepoint[codepoint];
+ } else {
+ if (utf8proc_islower(codepoint)) {
+ return utf8proc_toupper(codepoint);
+ } else if (utf8proc_isupper(codepoint)) {
+ return utf8proc_tolower(codepoint);
+ } else {
+ return codepoint;
+ }
Review comment:
The function does not ends with a `return` statement. Move the last
else-case `return codepoint` as the last statement of the function.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]