Change 27585 by [EMAIL PROTECTED] on 2006/03/23 14:09:33

        Make S_sv_pos_u2b_cached use both cache pairs.

Affected files ...

... //depot/perl/sv.c#1209 edit

Differences ...

==== //depot/perl/sv.c#1209 (text) ====
Index: perl/sv.c
--- perl/sv.c#1208~27584~       2006-03-23 05:47:41.000000000 -0800
+++ perl/sv.c   2006-03-23 06:09:33.000000000 -0800
@@ -5425,12 +5425,26 @@
                        + S_sv_pos_u2b_forwards(aTHX_ start + boffset0,
                                                send, uoffset - uoffset0);
                }
-           } else {
+           }
+           else if (cache[2] < uoffset) {
+               /* We're between the two cache entries.  */
+               if (cache[2] > uoffset0) {
+                   /* and the cache knows more than the passed in pair  */
+                   uoffset0 = cache[2];
+                   boffset0 = cache[3];
+               }
+
                boffset = boffset0
                    + S_sv_pos_u2b_midway(aTHX_ start + boffset0,
                                          start + cache[1],
                                          uoffset - uoffset0,
                                          cache[0] - uoffset0);
+           } else {
+               boffset = boffset0
+                   + S_sv_pos_u2b_midway(aTHX_ start + boffset0,
+                                         start + cache[3],
+                                         uoffset - uoffset0,
+                                         cache[2] - uoffset0);
            }
            found = TRUE;
        }
End of Patch.

Reply via email to