KalleOlaviNiemitalo commented on code in PR #3284:
URL: https://github.com/apache/avro/pull/3284#discussion_r1904943793
##########
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:
This loop looks like it has O(n^2) time complexity. Does boost::replace_all
have the same or only O(n)?
OTOH, this is in the schema compiler and not in data processing so perhaps
it doesn't matter.
--
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]