diff options
Diffstat (limited to 'Swiften/Elements/VCard.cpp')
-rw-r--r-- | Swiften/Elements/VCard.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Swiften/Elements/VCard.cpp b/Swiften/Elements/VCard.cpp index ffa90e7..571ead4 100644 --- a/Swiften/Elements/VCard.cpp +++ b/Swiften/Elements/VCard.cpp @@ -1,25 +1,23 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swiften/Elements/VCard.h> -#include <Swiften/Base/foreach.h> - namespace Swift { VCard::EMailAddress VCard::getPreferredEMailAddress() const { - foreach(const EMailAddress& address, emailAddresses_) { - if (address.isPreferred) { - return address; - } - } - if (!emailAddresses_.empty()) { - return emailAddresses_[0]; - } - return EMailAddress(); + for (const auto& address : emailAddresses_) { + if (address.isPreferred) { + return address; + } + } + if (!emailAddresses_.empty()) { + return emailAddresses_[0]; + } + return EMailAddress(); } |