/*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
char *
CacheManager::PasswdGet(Mgr::ActionPasswordList * a, const char *action)
{
- wordlist *w;
-
- while (a != NULL) {
- for (w = a->actions; w != NULL; w = w->next) {
- if (0 == strcmp(w->key, action))
+ while (a) {
+ for (auto &w : a->actions) {
+ if (w.cmp(action) == 0)
return a->passwd;
- if (0 == strcmp(w->key, "all"))
+ static const SBuf allAction("all");
+ if (w == allAction)
return a->passwd;
}