]> Sergey Matveev's repositories - nnn.git/commit
icons: use a compact array
authorNRK <nrk@disroot.org>
Sun, 24 Jul 2022 10:10:28 +0000 (16:10 +0600)
committerNRK <nrk@disroot.org>
Sun, 24 Jul 2022 10:24:11 +0000 (16:24 +0600)
commitfe9c1bbb3a51543b83eab9df08030fb66c2e5553
tree92550602cd21da963f6a7e2600dcab39bffa75b9
parent63a254951da0feeb5b11c1da2de4cf37c31f4450
icons: use a compact array

a lot of the extension use the same icon. this can be exploited via
having an array with all the unique icons and then storing a single byte
index into the unique array.

when using `O_EMOJI` this results in around ~1.7KiB drop in the total
table size. `O_NERD` and `O_ICONS` get roughly ~0.5KiB savings.
src/icons-hash.c
src/icons.h
src/nnn.c