Make fewer copies when using StringBuilder.
Replace calls to .str() which copies with .Release which moves in cases where that's safe. This CL was generated by this command: git grep -l 'StringBuilder' | xargs perl -i -0 -pe "s/(rtc::StringBuilder (\S+);.*?return )\\g2.str\(\)/\$1\$2.Release\(\)/sg" Bug: webrtc:8982 Change-Id: If4dadbeb039df010aaaa9e58da81c1971a84fe8f Reviewed-on: https://webrtc-review.googlesource.com/100307 Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24790}
This commit is contained in:
@ -78,7 +78,7 @@ void SortPacketFeedbackVector(std::vector<PacketFeedback>* vec) {
|
||||
std::string SsrcToString(uint32_t ssrc) {
|
||||
rtc::StringBuilder ss;
|
||||
ss << "SSRC " << ssrc;
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
// Checks whether an SSRC is contained in the list of desired SSRCs.
|
||||
@ -424,7 +424,7 @@ std::string GetCandidatePairLogDescriptionAsString(
|
||||
<< remote_candidate_type << ":"
|
||||
<< GetAddressFamilyAsString(config.remote_address_family) << "@"
|
||||
<< GetProtocolAsString(config.candidate_pair_protocol);
|
||||
return ss.str();
|
||||
return ss.Release();
|
||||
}
|
||||
|
||||
std::string GetDirectionAsString(PacketDirection direction) {
|
||||
|
||||
Reference in New Issue
Block a user