@van51 wish you were in IRC now to explain so now this way:

I actually don't know why I used a dynarray at all anymore. I mean the dictionary is allocated from scratch every time with the length of the vector + what is already there. Then it is compacted in a merge step (only unique n-grams are stored!). It doesn't matter if the dyn array has a true size of 100MB if after the compaction only 10MB are used. So this function here is not needed.