From e61718f658e04bf25a132218a0b5b748967cc2cc Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Tue, 20 Feb 2018 01:11:23 +0100 Subject: [PATCH] fix(Content): findHeader must be const (it is a getter) --- src/content/content.cpp | 10 +++++----- src/content/content.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/content.cpp b/src/content/content.cpp index ffabea95a..c6c218ea3 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -19,9 +19,9 @@ // TODO: Remove me later. #include "linphone/core.h" -#include "linphone/utils/utils.h" -#include +#include "linphone/utils/algorithm.h" +#include "linphone/utils/utils.h" #include "content-p.h" #include "content-type.h" @@ -186,7 +186,7 @@ void Content::addHeader (const string &headerName, const string &headerValue) { d->headers.push_back(make_pair(headerName, headerValue)); } -const list> &Content::getHeaders () const { +const list> &Content::getHeaders () const { L_D(); return d->headers; } @@ -198,9 +198,9 @@ void Content::removeHeader (const string &headerName) { d->headers.remove(*it); } -list>::const_iterator Content::findHeader (const string &headerName) { +list>::const_iterator Content::findHeader (const string &headerName) const { L_D(); - return find_if(d->headers.cbegin(), d->headers.cend(), [&headerName](const pair &pair) { + return findIf(d->headers, [&headerName](const pair &pair) { return pair.first == headerName; }); } diff --git a/src/content/content.h b/src/content/content.h index 03fddd7f2..a74bdd147 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -75,7 +75,7 @@ public: const std::list> &getHeaders () const; void addHeader (const std::string &headerName, const std::string &headerValue); void removeHeader (const std::string &headerName); - std::list>::const_iterator findHeader (const std::string &headerName); + std::list>::const_iterator findHeader (const std::string &headerName) const; // TODO: Remove me later. virtual LinphoneContent *toLinphoneContent () const;