[pcre-dev] PATCH: remove push_back (was Re: Compile error?)

Page principale
Supprimer ce message
Auteur: Craig Silverstein
Date:  
À: aj, ph10
CC: pcre-dev
Anciens-sujets: [pcre-dev] Compile error?
Sujet: [pcre-dev] PATCH: remove push_back (was Re: Compile error?)
It turns out there's no real reason to prefer push_back() to append()
or operator+=() (see, eg
http://www.velocityreviews.com/forums/t287060-stdstringpushback-vs-stdstringoperator.html).
So I've changed the push_back calls to use += instead, which may give
us a bit more portability. Philip, can you apply this when you get a
chance? Patch below.

craig

--cut here--

Index: pcrecpp.cc
===================================================================
--- pcrecpp.cc    (revision 328)
+++ pcrecpp.cc    (working copy)
@@ -609,14 +609,14 @@
         if (start >= 0)
           out->append(text.data() + start, vec[2 * n + 1] - start);
       } else if (c == '\\') {
-        out->push_back('\\');
+        *out += '\\';
       } else {
         //fprintf(stderr, "invalid rewrite pattern: %.*s\n",
         //        rewrite.size(), rewrite.data());
         return false;
       }
     } else {
-      out->push_back(c);
+      *out += c;
     }
   }
   return true;