[pdftex] Patch for better performance of map file reading
Heiko Oberdiek
oberdiek at uni-freiburg.de
Wed Jul 31 13:32:40 CEST 2002
On Wed, Jul 31, 2002 at 10:01:39AM +0200, Hans Hagen wrote:
> On todays machines there is no reason to stick to 8 byte names; when i buy
> some fonts, i prefer to generate files with names like
>
> texnansi-<optional alternative>-<optional mm scaling or slant or
> whatever>-originalname.tfm
Changed, see previous post.
%%% cut %%% mapfile.c.diff2 %%% cut %%%
*** mapfile.c 30 Jul 2002 23:12:50 -0000 1.2
--- mapfile.c 31 Jul 2002 10:28:52 -0000 1.3
***************
*** 94,101 ****
Parameter str: tfm font file name
Return value: position in hash table
Description:
! Most tfm file names obey the Karl-Berry-schema, so the
! string length is not greater than 8. The string is
converted into an int by dividing the first eight
bytes into two byte parts. These parts are then
combined by xor. As hashing function the multiplicative
--- 94,100 ----
Parameter str: tfm font file name
Return value: position in hash table
Description:
! For calculating the hash key, the string is
converted into an int by dividing the first eight
bytes into two byte parts. These parts are then
combined by xor. As hashing function the multiplicative
***************
*** 138,144 ****
double a;
int hash_code = 0;
int i;
! for (i=0; *str && i<4; i++, str++) {
hash_code ^= (*str << 8) + *++str;
if (!*str) {
break;
--- 137,143 ----
double a;
int hash_code = 0;
int i;
! for (i=0; *str; i++, str++) {
hash_code ^= (*str << 8) + *++str;
if (!*str) {
break;
%%% cut %%% mapfile.c.diff2 %%% cut %%%
Yours sincerely
Heiko <oberdiek at uni-freiburg.de>
More information about the pdftex
mailing list