Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: url/url_canon_relative.cc

Issue 2641823004: [url] Reserve size in a smarter way to account for pre-allocated buffers (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/url_canon.h ('k') | url/url_canon_stdstring.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_relative.cc
diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc
index 8259056f5e515320b27479316c561afa8165f61c..851368d8d4847a10ccdd12fa6b807e70822326cb 100644
--- a/url/url_canon_relative.cc
+++ b/url/url_canon_relative.cc
@@ -288,7 +288,7 @@ bool DoResolveRelativePath(const char* base_url,
// possible escaped characters.
output->ReserveSizeIfNeeded(
base_parsed.path.begin +
- std::max(path.end(), std::max(query.end(), ref.end())) + 8);
+ std::max(path.end(), std::max(query.end(), ref.end())));
output->Append(base_url, base_parsed.path.begin);
if (path.len > 0) {
@@ -406,7 +406,7 @@ bool DoResolveRelativeHost(const char* base_url,
// base URL.
output->ReserveSizeIfNeeded(
replacements.components().Length() +
- base_parsed.CountCharactersBefore(Parsed::USERNAME, false) + 8);
+ base_parsed.CountCharactersBefore(Parsed::USERNAME, false));
return ReplaceStandardURL(base_url, base_parsed, replacements,
query_converter, output, out_parsed);
}
« no previous file with comments | « url/url_canon.h ('k') | url/url_canon_stdstring.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698