Skip to content

Commit

Permalink
Unicode-Normalize: Save '&' instrs by casting to U8
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Jul 24, 2021
1 parent 471e598 commit 161bab6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/Unicode-Normalize/Normalize.pm
Expand Up @@ -7,7 +7,7 @@ use Carp;

no warnings 'utf8';

our $VERSION = '1.29';
our $VERSION = '1.30';
our $PACKAGE = __PACKAGE__;

our @EXPORT = qw( NFC NFD NFKC NFKD );
Expand Down
16 changes: 8 additions & 8 deletions dist/Unicode-Normalize/Normalize.xs
Expand Up @@ -139,8 +139,8 @@ static U8* dec_canonical(UV uv)
plane = (U8***)UNF_canon[uv >> 16];
if (! plane)
return NULL;
row = plane[(uv >> 8) & 0xff];
return row ? row[uv & 0xff] : NULL;
row = plane[(U8) (uv >> 8)];
return row ? row[(U8) uv] : NULL;
}

static U8* dec_compat(UV uv)
Expand All @@ -151,8 +151,8 @@ static U8* dec_compat(UV uv)
plane = (U8***)UNF_compat[uv >> 16];
if (! plane)
return NULL;
row = plane[(uv >> 8) & 0xff];
return row ? row[uv & 0xff] : NULL;
row = plane[(U8) (uv >> 8)];
return row ? row[(U8) uv] : NULL;
}

static UV composite_uv(UV uv, UV uv2)
Expand All @@ -175,10 +175,10 @@ static UV composite_uv(UV uv, UV uv2)
plane = UNF_compos[uv >> 16];
if (! plane)
return 0;
row = plane[(uv >> 8) & 0xff];
row = plane[(U8) (uv >> 8)];
if (! row)
return 0;
cell = row[uv & 0xff];
cell = row[(U8) uv];
if (! cell)
return 0;
for (i = cell; i->nextchar; i++) {
Expand All @@ -196,8 +196,8 @@ static U8 getCombinClass(UV uv)
plane = (U8**)UNF_combin[uv >> 16];
if (! plane)
return 0;
row = plane[(uv >> 8) & 0xff];
return row ? row[uv & 0xff] : 0;
row = plane[(U8) (uv >> 8)];
return row ? row[(U8) uv] : 0;
}

static U8* pv_cat_decompHangul(pTHX_ U8* d, UV uv)
Expand Down

0 comments on commit 161bab6

Please sign in to comment.