Stop SimplifyStringSet() from finding "" in everything.

Change-Id: I98313d86a5a4653b449bf943ea0c57844dfcc130
Reviewed-on: https://code-review.googlesource.com/c/re2/+/42510
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/prefilter.cc b/re2/prefilter.cc
index 4d6df8d..f0d9264 100644
--- a/re2/prefilter.cc
+++ b/re2/prefilter.cc
@@ -145,10 +145,13 @@
   // we know "ab" is a required string, then it doesn't help at all to
   // know that "abc" is also a required string, so delete "abc". This
   // is because, when we are performing a string search to filter
-  // regexps, matching ab will already allow this regexp to be a
-  // candidate for match, so further matching abc is redundant.
-
+  // regexps, matching "ab" will already allow this regexp to be a
+  // candidate for match, so further matching "abc" is redundant.
+  // Note that we must ignore "" because find() would find it at the
+  // start of everything and thus we would end up erasing everything.
   for (SSIter i = ss->begin(); i != ss->end(); ++i) {
+    if (i->empty())
+      continue;
     SSIter j = i;
     ++j;
     while (j != ss->end()) {