Skip to content

Commit ee13dba

Browse files
author
Fredrik Lundh
committed
more unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >
sizeof(int)
1 parent e9218a1 commit ee13dba

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Objects/unicodectype.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ typedef struct {
3232
#include "unicodetype_db.h"
3333

3434
static const _PyUnicode_TypeRecord *
35-
gettyperecord(int code)
35+
gettyperecord(Py_UNICODE code)
3636
{
3737
int index;
3838

39-
if (code < 0 || code >= 65536)
39+
if (code >= 65536)
4040
index = 0;
4141
else {
4242
index = index1[(code>>SHIFT)];
4343
index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
4444
}
45+
4546
return &_PyUnicode_TypeRecords[index];
4647
}
4748

0 commit comments

Comments
 (0)