|
From: Jaakko N. <jni...@us...> - 2009-11-14 17:43:35
|
Module: performous
Branch: dance
Commit: 302bcad6b6a1f5b7186d8996052718ac76251dee
Author: Jaakko Nikkola <jaa...@tk...>
Date: Sat Nov 14 15:55:53 2009 +0200
some function parameters into references
---
game/songparser-sm.cc | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index c501e57..3669a4a 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -42,15 +42,11 @@ void SongParser::smParse() {
while (getline(line) && smParseField(line)) {}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
if (m_bpm != 0.0) addBPM(0, m_bpm);
-
- // Workaround for the terminating : 1 0 0 line, written by some converters
-/* if (!s.notes.empty() && s.notes.back().type != Note::SLEEP && s.notes.back().begin == s.notes.back().end) s.notes.pop_back();
-*/
}
-bool SongParser::smParseField(std::string line) {
+bool SongParser::smParseField(std::string& line) {
if (line.empty()) return true;
- if (line[0] == '/' && line[1] == '/') return true; //jump over possible comments
+ if (line[0] == '/') return true; //jump over possible comments
std::string::size_type pos = line.find(':');
if (pos == std::string::npos) throw std::runtime_error("Invalid format, should be #key:value");
std::string key = boost::trim_copy(line.substr(1, pos - 1));
@@ -129,7 +125,7 @@ bool SongParser::smParseField(std::string line) {
return true;
}
-bool SongParser::smParseNote(std::string line, DanceChords chords){
+bool SongParser::smParseNote(std::string& line, DanceChords& chords){
if(line.empty()) return true;
if(line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if(line[0] == ';') return false; //end mark
|