drop duplicate tokens
The comments in the middle of some code are considered to be the comments that are before all of the tokens except the first. When there is a declaration that involves multiple variables, the tokens representing the type are repeated. This causes a comment before the declaration to be considered to be in the middle, because the first token appears again in the second position, and would cause comments in the middle of the type to be duplicated in the list of comments in the middle. Drop such duplicated tokens, benefitting from the fact that the list of tokens is sorted.