summaryrefslogtreecommitdiff
path: root/i18npool/source/localedata/LocaleNode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/localedata/LocaleNode.cxx')
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index f9436d5ddf9a..273d40698a8f 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -2301,10 +2301,13 @@ Attr::Attr (const Reference< XAttributeList > & attr) {
}
OUString Attr::getValueByName (const sal_Char *str) const {
- sal_Int32 len = name.getLength();
- for (sal_Int32 i = 0;i<len;i++)
- if (name[i].equalsAscii(str))
- return value[i];
+ auto pName = std::find_if(std::cbegin(name), std::cend(name),
+ [&str](const OUString& rName) { return rName.equalsAscii(str); });
+ if (pName != std::cend(name))
+ {
+ auto i = static_cast<sal_Int32>(std::distance(std::cbegin(name), pName));
+ return value[i];
+ }
return OUString();
}