Perform typename re-colourisation only when typename list changes
commit9356514e457c34da3169b6531862b538e1a961bb
authorJiří Techet <techet@gmail.com>
Tue, 17 May 2016 20:58:47 +0000 (17 22:58 +0200)
committerJiří Techet <techet@gmail.com>
Tue, 17 May 2016 20:58:47 +0000 (17 22:58 +0200)
tree3df8a729e018a372e30ecde0c64047e710509401
parent9313b17559f4ea60acae95db96523dbd02c80e35
Perform typename re-colourisation only when typename list changes

To detect the change of typename list since the last time the colourisation
happened, we could store the complete typename string used during the
last colourization and compare it with the current string. For lots of
typenames this might be quite a huge string stored for every opened tab
(well, it's also stored in Scintilla already for every document but better
not to have it twice). Instead, we can store an uint hash of the string.
We could also use a better hash function with longer hash value but
uint size should be enough for this case (and in the case of a collision
nothing terrible happens).
src/document.c
src/documentprivate.h