This is a followup to Difference in compilation time between two slightly different versions.
As became obvious when asking that question, the speed of that compilation is seriously affected by the length of the comma separated list \ReferencedID
. This is the list of the labels collected from the text. But this list may contain duplicates, and in fact in the example in my question, it does. So, how can one delete duplicates from a comma-separated list?
For concreteness, the list is my example is:
\gdef \ReferencedIDs{,2014.11.14,2014.11.14,2014.11.17,2014.11.14,2014.07.18.tm,2014.11.12.tm,2013.10.05.kanjur,2013.10.05.powai,2013.10.06,2013.10.28.zhm,2013.10.17,2013.10.22,2013.10.14.ks,2013.10.06,2013.10.17,2013.10.22,2013.10.24,2013.10.28,2013.10.30,2013.11.11,2014.09.05.tm,2014.07.18.tm,2014.11.12.tm,2014.11.17,2015.01.06,2015.01.06}