]> git.eshelyaron.com Git - emacs.git/commit
Optimize UCS normalization tests
authorNoam Postavsky <npostavs@gmail.com>
Sat, 8 Jul 2017 17:20:17 +0000 (13:20 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 8 Jul 2017 18:31:27 +0000 (14:31 -0400)
commit06ff34cd2a86bde6ecc0baa613550bd7ed96f411
treea2e7dba9cfb458493a02bad9dc151440a6417f4a
parenta163391845c7fcc3287d4ef0b641ee0d178e6b9a
Optimize UCS normalization tests

Brings the the time for `ucs-normalize-part1' from 200s down to 130s.
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--parse-column): Use character instead of string
of length 1 for terminator.  Convert return value into string since
all callers need that form anyway.
(ucs-normalize-tests--normalization-equal-p): Rename from
ucs-normalize-tests--normalize.  Use dedicated buffer instead of
messing with narrowing.  Take string to compare against and insert it
into buffer so that compare-buffer-substrings can be used instead of
allocating a new string from buffer contents.
(ucs-normalize-tests--normalization-chareq-p): New macro, specialized
for comparing single character.
(ucs-normalize-tests--rule1-holds-p)
(ucs-normalize-tests--rule2-holds-p): Turn into defsubst.
(ucs-normalize-tests--rule1-failing-for-partX): Use `eq' instead of
`='.
test/lisp/international/ucs-normalize-tests.el