Skip to content

Commit

Permalink
Fixing a comment and vector type. (facebookincubator#10410)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookincubator#10410

- Fixing a comment.
- Reducing hard coded vector types as max hard coded value can be limited to smaller types.

Differential Revision: D59424733
  • Loading branch information
amitkdutta authored and facebook-github-bot committed Jul 8, 2024
1 parent 770f2ad commit 5153b11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion velox/functions/lib/string/StringCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions velox/functions/lib/string/StringImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ FOLLY_ALWAYS_INLINE bool md5_radix(

namespace {
FOLLY_ALWAYS_INLINE int64_t asciiWhitespaces() {
std::vector<int32_t> 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);
Expand All @@ -318,7 +318,7 @@ FOLLY_ALWAYS_INLINE int64_t asciiWhitespaces() {
}

FOLLY_ALWAYS_INLINE int64_t asciiWhitespaceCodes() {
std::vector<int32_t> 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);
Expand All @@ -327,7 +327,7 @@ FOLLY_ALWAYS_INLINE int64_t asciiWhitespaceCodes() {
}

FOLLY_ALWAYS_INLINE std::array<int64_t, 2> unicodeWhitespaceCodes() {
std::vector<int32_t> codes = {
int16_t codes[] = {
8192,
8193,
8194,
Expand Down

0 comments on commit 5153b11

Please sign in to comment.