From 0e0400022c4d1454215cddc14e6a0ac1826c5f98 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 5 Sep 2019 20:02:46 -0700 Subject: [PATCH] vx const fixup std::set iteration really should always be const as mutation would invalidate the ordering. --- pdbApp/pvif.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdbApp/pvif.cpp b/pdbApp/pvif.cpp index 2748ed9..61edff1 100644 --- a/pdbApp/pvif.cpp +++ b/pdbApp/pvif.cpp @@ -88,11 +88,11 @@ void ASCred::update(const pva::ChannelRequester::shared_pointer& req) usertemp = info->authority + "/" + info->account; } - static const char role[] = "role/"; + const char role[] = "role/"; groups.resize(info->roles.size()); size_t idx = 0u; - for(pva::PeerInfo::roles_t::iterator it(info->roles.begin()), end(info->roles.end()); it!=end; ++it, idx++) { + for(pva::PeerInfo::roles_t::const_iterator it(info->roles.begin()), end(info->roles.end()); it!=end; ++it, idx++) { groups[idx].resize((*it).size()+sizeof(role)); // sizeof(role) includes trailing nil std::copy(role, role+sizeof(role)-1, @@ -109,7 +109,7 @@ void ASCred::update(const pva::ChannelRequester::shared_pointer& req) } // remote names have the form "IP:port" - size_t sep = hosttemp.find_first_of(":"); + size_t sep = hosttemp.find_first_of(':'); if(sep == std::string::npos) { sep = hosttemp.size(); }