Skip to content

Commit

Permalink
Code modernization: src/n*, src/o* (#6280)
Browse files Browse the repository at this point in the history
* Code modernization: src/n*, src/o*

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* remove unused IWritableNodeDefManager::clone()
* C++ STL header style
* Pointer constness in some functions
  • Loading branch information
nerzhul committed Aug 19, 2017
1 parent 4a1265c commit 1992db1
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 287 deletions.
3 changes: 1 addition & 2 deletions src/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ bool Metadata::operator==(const Metadata &other) const
return false;

for (const auto &sv : m_stringvars) {
if (!other.contains(sv.first) ||
other.getString(sv.first) != sv.second)
if (!other.contains(sv.first) || other.getString(sv.first) != sv.second)
return false;
}

Expand Down
7 changes: 3 additions & 4 deletions src/nameidmapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ void NameIdMapping::serialize(std::ostream &os) const
{
writeU8(os, 0); // version
writeU16(os, m_id_to_name.size());
for (IdToNameMap::const_iterator i = m_id_to_name.begin();
i != m_id_to_name.end(); ++i) {
writeU16(os, i->first);
os << serializeString(i->second);
for (const auto &i : m_id_to_name) {
writeU16(os, i.first);
os << serializeString(i.second);
}
}

Expand Down
Loading

0 comments on commit 1992db1

Please sign in to comment.