From b6d3f000b981826589d78733ad358bc5ea204a30 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Wed, 2 May 2012 00:28:35 +0430 Subject: [PATCH] pad: improve the hash function Note that in ascii table, characters 0-31 are non-printable. --- pad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.11.4.GIT