Skip to content
Permalink
Browse files
Short circuit case-insensitive compare of two equal Unicode codepoints.
  • Loading branch information
icculus committed Aug 15, 2014
1 parent 628b88f commit 4b906c1e5fa3f17e509abcd0890477328cf1cfa2
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/physfs_unicode.c
@@ -447,6 +447,10 @@ static void locate_case_fold_mapping(const PHYSFS_uint32 from,
static int utf8codepointcmp(const PHYSFS_uint32 cp1, const PHYSFS_uint32 cp2)
{
PHYSFS_uint32 folded1[3], folded2[3];

if (cp1 == cp2)
return 0; /* obviously matches. */

locate_case_fold_mapping(cp1, folded1);
locate_case_fold_mapping(cp2, folded2);

0 comments on commit 4b906c1

Please sign in to comment.