diff options
Diffstat (limited to 'Swiften/Jingle/Jingle.h')
-rw-r--r-- | Swiften/Jingle/Jingle.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Swiften/Jingle/Jingle.h b/Swiften/Jingle/Jingle.h index bf05b1c..0cd1a23 100644 --- a/Swiften/Jingle/Jingle.h +++ b/Swiften/Jingle/Jingle.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,15 +11,15 @@ #include <Swiften/Elements/JingleContentPayload.h> namespace Swift { - namespace Jingle { - template<typename T> - JingleContentPayload::ref getContentWithDescription(const std::vector<JingleContentPayload::ref>& contents) { - for (size_t i = 0; i < contents.size(); ++i) { - if (contents[i]->getDescription<T>()) { - return contents[i]; - } - } - return JingleContentPayload::ref(); - } - } + namespace Jingle { + template<typename T> + JingleContentPayload::ref getContentWithDescription(const std::vector<JingleContentPayload::ref>& contents) { + for (const auto& content : contents) { + if (content->getDescription<T>()) { + return content; + } + } + return JingleContentPayload::ref(); + } + } } |