[dev] [st] [patch] Cleanup config.def.h, eliminate mappedkeys, simplify matching.

From: Mark Edgar <medgar123_AT_gmail.com>
Date: Sat, 19 Oct 2013 03:02:57 +0200

A series of patches for consideration.

The first patch is purely aesthetic: it cleans up column headings
(comments) and internal tabs in the shortcuts/key/mshortcuts tables in
config.def.h. It also renames the fields in Key to match the nicer names
given in config.def.h.

The second patch removes the mappedkeys[] optimization. I tested this by
adding 1.000.000 additional entries to the end of key[]:

static Key key[] = {
#include "lots"
 * "lots" contains 999.999 repetitions of this entry, which is crafted
 * to hit all the tests in kmap() and fail the last:
 * { 'x', XK_ANY_MOD, "nope", .keypad=-1, .cursor=-1, .crlf=1 },
  { 'x', XK_NO_MOD, "exit" },

While gcc goes from a few seconds to more than a minute to compile and link
the above, I could not detect a performance regression in st. ;)

The third patch simplifies the matching logic in kmap() and match() without
changing the behavior. Hopefully, it is straightforward, but it probably
deserves a careful reading to make sure I haven't made any mistakes.


Received on Sat Oct 19 2013 - 03:02:57 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 19 2013 - 03:12:19 CEST