From 5153b11b534a15633b2e575c06a72ccfc85d0a28 Mon Sep 17 00:00:00 2001 From: Amit Dutta Date: Mon, 8 Jul 2024 09:34:47 -0700 Subject: [PATCH] Fixing a comment and vector type. (#10410) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/10410 - Fixing a comment. - Reducing hard coded vector types as max hard coded value can be limited to smaller types. Differential Revision: D59424733 --- velox/functions/lib/string/StringCore.h | 2 +- velox/functions/lib/string/StringImpl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/velox/functions/lib/string/StringCore.h b/velox/functions/lib/string/StringCore.h index 4f9817209e17..c177ef8ba2d3 100644 --- a/velox/functions/lib/string/StringCore.h +++ b/velox/functions/lib/string/StringCore.h @@ -359,7 +359,7 @@ inline int64_t findNthInstanceByteIndexFromEnd( /// Replace replaced with replacement in inputString and write results in /// outputString. If inPlace=true inputString and outputString are assumed to -/// tbe the same. When replaced is empty and ignoreEmptyReplaced is false, +/// be the same. When replaced is empty and ignoreEmptyReplaced is false, /// replacement is added before and after each charecter. When replaced is /// empty and ignoreEmptyReplaced is true, the result is the inputString value. /// When inputString is empty results is empty. diff --git a/velox/functions/lib/string/StringImpl.h b/velox/functions/lib/string/StringImpl.h index bda4da1f423d..4d9f3dcfa0f4 100644 --- a/velox/functions/lib/string/StringImpl.h +++ b/velox/functions/lib/string/StringImpl.h @@ -309,7 +309,7 @@ FOLLY_ALWAYS_INLINE bool md5_radix( namespace { FOLLY_ALWAYS_INLINE int64_t asciiWhitespaces() { - std::vector codes = {9, 10, 11, 12, 13, 28, 29, 30, 31, 32}; + int8_t codes[] = {9, 10, 11, 12, 13, 28, 29, 30, 31, 32}; int64_t bitMask = 0; for (auto code : codes) { bits::setBit(&bitMask, code, true); @@ -318,7 +318,7 @@ FOLLY_ALWAYS_INLINE int64_t asciiWhitespaces() { } FOLLY_ALWAYS_INLINE int64_t asciiWhitespaceCodes() { - std::vector codes = {9, 10, 11, 12, 13, 28, 29, 30, 31, 32}; + int8_t codes[] = {9, 10, 11, 12, 13, 28, 29, 30, 31, 32}; int64_t bitMask = 0; for (auto code : codes) { bits::setBit(&bitMask, code, true); @@ -327,7 +327,7 @@ FOLLY_ALWAYS_INLINE int64_t asciiWhitespaceCodes() { } FOLLY_ALWAYS_INLINE std::array unicodeWhitespaceCodes() { - std::vector codes = { + int16_t codes[] = { 8192, 8193, 8194,