dependency on absl internals in getCodePointLength

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • Service arch 2020-10-19
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Reaching into the absl internals is dangerous.
      It's unnecessary in this case, and should be avoided.

      + #include "mongo/platform/bits.h"
      ...
      getCodePointLength
      -    return absl::base_internal::CountLeadingZeros64(~(uint64_t(charByte) << (64 - 8)));
      +    return countLeadingZeros64(~static_cast<unsigned char>(charByte)) - (64 - 8);
       }
      

              Assignee:
              Billy Donahue
              Reporter:
              Billy Donahue
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: