Commit 87c01d5e authored by Geoff Simmons's avatar Geoff Simmons

The <algortihm> header is evidently necessary for std::sort

for some early versions of re2.

Also get rid of an unnecessary #include "config.h".
parent 27151c11
Pipeline #340 skipped
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
* *
*/ */
#include "config.h" #include <algorithm>
#include "vre2set.h" #include "vre2set.h"
#define CATCHALL \ #define CATCHALL \
...@@ -158,7 +159,7 @@ vre2set_match(vre2set *set, const char * const subject, int * const match, ...@@ -158,7 +159,7 @@ vre2set_match(vre2set *set, const char * const subject, int * const match,
if (m.size() * sizeof(int) > buflen) if (m.size() * sizeof(int) > buflen)
return "insufficient space to copy match data"; return "insufficient space to copy match data";
*nmatches = m.size(); *nmatches = m.size();
sort(m.begin(), m.end()); std::sort(m.begin(), m.end());
memcpy(buf, m.data(), *nmatches * sizeof(int)); memcpy(buf, m.data(), *nmatches * sizeof(int));
} }
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment