- int ix;
- const char *elem, *last = NULL;
- int out;
-
- qsort (VEC_address (const_char_ptr, *strings),
- VEC_length (const_char_ptr, *strings),
- sizeof (const_char_ptr),
- compare_strings);
- out = 0;
- for (ix = 0; VEC_iterate (const_char_ptr, *strings, ix, elem); ++ix)
- {
- if (last == NULL || strcmp (last, elem) != 0)
- {
- /* Keep ELEM. */
- VEC_replace (const_char_ptr, *strings, out, elem);
- ++out;
- }
- last = elem;
- }
- VEC_truncate (const_char_ptr, *strings, out);
+ if (strings->empty ())
+ return;
+
+ std::sort (strings->begin (), strings->end (), compare_cstrings);
+ strings->erase (std::unique (strings->begin (), strings->end (), streq),
+ strings->end ());