Skip to content

Commit

Permalink
vx const fixup
Browse files Browse the repository at this point in the history
std::set iteration really should always be const
as mutation would invalidate the ordering.
  • Loading branch information
mdavidsaver committed Sep 6, 2019
1 parent bdbf573 commit 0e04000
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdbApp/pvif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
}
Expand Down

0 comments on commit 0e04000

Please sign in to comment.