Skip to content

Commit

Permalink
Minor fixups to S_trie_bitmap_set_folded()
Browse files Browse the repository at this point in the history
This is a new static function which replaces a similar macro. Yves
pointed out that 'uvc' wasn't a good name for a variable which isn't of
type UV, and Hugo pointed out that a (U8) cast was redundant.
  • Loading branch information
iabyn committed Apr 2, 2024
1 parent 589e2b8 commit a73aa54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions regcomp_trie.c
Expand Up @@ -523,18 +523,18 @@ is the recommended Unicode-aware way of saying

STATIC void
S_trie_bitmap_set_folded(pTHX_ RExC_state_t *pRExC_state,
reg_trie_data *trie, U8 uvc, const U8 * folder)
reg_trie_data *trie, U8 ch, const U8 * folder)
{
TRIE_BITMAP_SET(trie, uvc);
TRIE_BITMAP_SET(trie, ch);
/* store the folded codepoint */
if ( folder )
TRIE_BITMAP_SET(trie, folder[(U8) uvc ]);
TRIE_BITMAP_SET(trie, folder[ch]);

if ( !UTF ) {
/* store first byte of utf8 representation of */
/* variant codepoints */
if (! UVCHR_IS_INVARIANT(uvc)) {
U8 hi = UTF8_TWO_BYTE_HI(uvc);
if (! UVCHR_IS_INVARIANT(ch)) {
U8 hi = UTF8_TWO_BYTE_HI(ch);
/* Note that hi will be either 0xc2 or 0xc3, and
* TRIE_BITMAP_SET() will do >>3 to get the byte offset
* within the bit table, which is constant, and Coverity
Expand Down

0 comments on commit a73aa54

Please sign in to comment.