Add performance optimization for empty RtpPacketInfos.
Bug: webrtc:10668 Change-Id: I879afbb2d6aad77e9db97f8b6a938bf760aab9f5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146703 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Commit-Queue: Chen Xing <chxg@google.com> Cr-Commit-Position: refs/heads/master@{#28653}
This commit is contained in:
parent
bc6f113bd2
commit
1796a820f6
@ -76,6 +76,11 @@ class RtpPacketInfos {
|
|||||||
class Data : public rtc::RefCountedBase {
|
class Data : public rtc::RefCountedBase {
|
||||||
public:
|
public:
|
||||||
static rtc::scoped_refptr<Data> Create(vector_type entries) {
|
static rtc::scoped_refptr<Data> Create(vector_type entries) {
|
||||||
|
// Performance optimization for the empty case.
|
||||||
|
if (entries.empty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
return new Data(entries);
|
return new Data(entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user