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:
@ -76,6 +76,11 @@ class RtpPacketInfos {
|
||||
class Data : public rtc::RefCountedBase {
|
||||
public:
|
||||
static rtc::scoped_refptr<Data> Create(vector_type entries) {
|
||||
// Performance optimization for the empty case.
|
||||
if (entries.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new Data(entries);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user