I just noticed this while debugging. The "key" string is quite often empty, so the code should do a quick check for empty string and return immediately.