KalleOlaviNiemitalo commented on code in PR #3284:
URL: https://github.com/apache/avro/pull/3284#discussion_r1904945479
##########
lang/c++/impl/Compiler.cc:
##########
@@ -136,7 +136,11 @@ int64_t getLongField(const Entity &e, const Object &m,
// Unescape double quotes (") for de-serialization. This method complements
the
// method NodeImpl::escape() which is used for serialization.
static void unescape(string &s) {
- boost::replace_all(s, "\\\"", "\"");
+ std::string::size_type pos = 0;
+ while ((pos = s.find("\\\"", pos)) != std::string::npos) {
+ s.replace(pos, 2, "\"");
+ pos += 2;
+ }
Review Comment:
O(n^2) because each iteration removes one character from the string and has
to move all the following characters.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]