|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-14 18:43:21
|
Module: performous
Branch: dance
Commit: 285fc2c0c584e13a5594fbe949bb5cc991c03b1f
Author: Markus Raab <un...@ma...>
Date: Wed Nov 11 10:25:15 2009 +0100
pass NodeSet by reference
NodeSet is a vector<Node*>, so better avoid copying
---
game/hiscore.cc | 2 +-
game/hiscore.hh | 2 +-
game/players.cc | 2 +-
game/players.hh | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/hiscore.cc b/game/hiscore.cc
index 3019f8f..2082a60 100644
--- a/game/hiscore.cc
+++ b/game/hiscore.cc
@@ -24,7 +24,7 @@ void Hiscore::addHiscore(int score, int playerid, int songid, std::string const&
m_hiscore.insert(hi);
}
-void Hiscore::load(xmlpp::NodeSet n)
+void Hiscore::load(xmlpp::NodeSet const& n)
{
for (xmlpp::NodeSet::const_iterator it = n.begin(); it != n.end(); ++it)
{
diff --git a/game/hiscore.hh b/game/hiscore.hh
index 1066f4c..a7cbe89 100644
--- a/game/hiscore.hh
+++ b/game/hiscore.hh
@@ -40,7 +40,7 @@ class Hiscore
public:
Hiscore ();
- void load(xmlpp::NodeSet n);
+ void load(xmlpp::NodeSet const& n);
void save(xmlpp::Element *players);
void addHiscore(int score, int playerid, int songid, std::string const& track);
diff --git a/game/players.cc b/game/players.cc
index fab2c76..51eedae 100644
--- a/game/players.cc
+++ b/game/players.cc
@@ -24,7 +24,7 @@ Players::Players():
Players::~Players()
{ }
-void Players::load(xmlpp::NodeSet n) {
+void Players::load(xmlpp::NodeSet const& n) {
for (xmlpp::NodeSet::const_iterator it = n.begin(); it != n.end(); ++it)
{
xmlpp::Element& element = dynamic_cast<xmlpp::Element&>(**it);
diff --git a/game/players.hh b/game/players.hh
index 5350b6f..d8a64d1 100644
--- a/game/players.hh
+++ b/game/players.hh
@@ -42,7 +42,7 @@ class Players: boost::noncopyable {
Players();
~Players();
- void load(xmlpp::NodeSet n);
+ void load(xmlpp::NodeSet const& n);
void save(xmlpp::Element *players);
void update();
|