From: Ali Gholami Rudi Date: Tue, 1 May 2012 19:58:35 +0000 (+0430) Subject: pad: improve the hash function X-Git-Url: https://repo.or.cz/w/fbpad.git/commitdiff_plain/b6d3f000b981826589d78733ad358bc5ea204a30 pad: improve the hash function Note that in ascii table, characters 0-31 are non-printable. --- diff --git a/pad.c b/pad.c index 9dc003e..61382a3 100644 --- a/pad.c +++ b/pad.c @@ -97,7 +97,7 @@ static struct glyph { static struct glyph *glyph_entry(int c, int fn, int fg, int bg) { - return &glyphs[(c ^ (fg << 7) ^ (bg << 6) ^ (fn << 8)) & (NCACHE - 1)]; + return &glyphs[((c - 32) ^ (fg << 6) ^ (bg << 5) ^ (fn << 8)) & (NCACHE - 1)]; } static fbval_t *glyph_cache(int c, int fn, short fg, short bg)