-
Notifications
You must be signed in to change notification settings - Fork 586
Make JsonEncode() a bit faster #10400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -333,11 +333,21 @@ String icinga::operator+(const String& lhs, const char *rhs) | |||
return lhs.GetData() + rhs; | ||||
} | ||||
|
||||
String icinga::operator+(String&& lhs, const char *rhs) | ||||
{ | ||||
return std::move(lhs.GetData()) + rhs; | ||||
} | ||||
|
||||
String icinga::operator+(const char *lhs, const String& rhs) | ||||
{ | ||||
return lhs + rhs.GetData(); | ||||
} | ||||
|
||||
String icinga::operator+(const char *lhs, String&& rhs) | ||||
{ | ||||
return lhs + std::move(rhs.GetData()); | ||||
} | ||||
Comment on lines
+336
to
+349
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you get here? Like how did you get to the conclusion that this will be a useful optimization? (Also, I really wonder if there's actually an implementation of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Checkout 27e1850 and Cmd+LClick the + sign in Line 199 in 27e1850
CLion will open
As long as there's enough free capacity, there's no reason to reallocate.
Exactly. |
||||
|
||||
bool icinga::operator==(const String& lhs, const String& rhs) | ||||
{ | ||||
return lhs.GetData() == rhs.GetData(); | ||||
|
Uh oh!
There was an error while loading. Please reload this page.