Fast, pure C++ removal of duplicate path vars