<div dir="ltr">Ah, thanks! fixed.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 6, 2015 at 7:29 AM, Raimund Steger <span dir="ltr"><<a href="mailto:rs@mytum.de" target="_blank">rs@mytum.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/05/15 09:56, Akira TAGOH wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
just committed the change. that should works better now.<br>
</blockquote>
<br>
<br></span>
Yup it's fast again now... but:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  FcBool<br>
  FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)<br>
  {<br>
-    int        i;<br>
+    int lower = 0, higher = b->nblank, middle;<br>
<br>
-    for (i = 0; i < b->nblank; i++)<br>
-       if (b->blanks[i] == ucs4)<br>
+    if (b->nblank == 0 ||<br>
+       b->blanks[0] > ucs4 ||<br>
+       b->blanks[b->nblank - 1] < ucs4)<br>
+       return FcFalse;<br>
+    while (1)<br>
+    {<br>
+       middle = (lower + higher) / 2;<br>
+       if (b->blanks[middle] == ucs4)<br>
            return FcTrue;<br>
+       if (middle == lower ||<br>
+           middle == higher)<br>
</blockquote>
<br>
<br>
wouldn't this need to be:<br>
<br>
  if (lower == higher)<br>
<br>
<br>
Rationale:<br>
<br>
If lower and higher are 1 apart, one bound will be checked, but not the other. For the current list of blanks and my font cache, I observed the following with ucs4==0xfe07 (which is /in/ the list):<br>
<br>
<br>
sun2:fontconfig)dbx `which fc-cache`<br>
[...]<br>
(dbx) runargs -f<br>
(dbx) stop at fcblanks.c:93 -if higher-lower==1 && ucs4==0xfe07<br>
(2) stop at "fcblanks.c":93 -if higher-lower == 1 && ucs4 == 0xfe07<br>
(dbx) run<br>
Running: fc-cache -f<br>
(process id 22766)<br>
t@1 (l@1) stopped in FcBlanksIsMember at line 93 in file "fcblanks.c"<br>
   93           middle = (lower + higher) / 2;<br>
(dbx) next<br>
t@1 (l@1) stopped in FcBlanksIsMember at line 94 in file "fcblanks.c"<br>
   94           if (b->blanks[middle] == ucs4)<br>
(dbx) print lower,middle,higher,b->blanks[<u></u>middle],b->blanks[higher],ucs4<br>
lower = 62<br>
middle = 62<br>
higher = 63<br>
b->blanks[middle] = 65030U<br>
b->blanks[higher] = 65031U<br>
ucs4 = 65031U<br>
(dbx) next<br>
t@1 (l@1) stopped in FcBlanksIsMember at line 97 in file "fcblanks.c"<br>
   97               middle == higher)<br>
(dbx) next<br>
t@1 (l@1) stopped in FcBlanksIsMember at line 98 in file "fcblanks.c"<br>
   98               break;<br>
(dbx) next<br>
t@1 (l@1) stopped in FcBlanksIsMember at line 105 in file "fcblanks.c"<br>
  105       return FcFalse;<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
-- <br>
Worringer Str 31 Duesseldorf 40211 DE  home: <<a href="mailto:rs@mytum.de" target="_blank">rs@mytum.de</a>><br>
<a href="tel:%2B49-179-2981632" value="+491792981632" target="_blank">+49-179-2981632</a> icq 16845346           work: <<a href="mailto:rs@interface-ag.de" target="_blank">rs@interface-ag.de</a>><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Akira TAGOH</div>
</div>