Commit e4bb668a authored by Adriaan de Groot's avatar Adriaan de Groot 💬
Browse files

tgf files: reduce compiler warnings

 - be consistent(er) in C++11 style iterations instead of foreach()
 - use const auto & instead of making copies (that's what the
   compiler was warning about, and the potential problem with
   C++11 style iterations)
parent fa36a4fb
......@@ -122,7 +122,7 @@ void TgfFileFormat::writeFile(GraphDocumentPtr document)
QTextStream out(&fileHandle);
// export data elements
//FIXME only default data type considered
foreach(NodePtr node, document->nodes()) {
for(const NodePtr &node : document->nodes()) {
out << node->id();
out << " ";
out << node->dynamicProperty("label").toString(); //TODO change to selectable property
......@@ -130,7 +130,7 @@ void TgfFileFormat::writeFile(GraphDocumentPtr document)
}
out << "#\n";
// export pointers
for (auto const edge : document->edges()) {
for (const auto &edge : document->edges()) {
out << edge->from()->id() << " " << edge->to()->id() << " " << edge->dynamicProperty("label").toString() <<'\n';
}
setError(None);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment