-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some bug fixes and very minor refactoring #930
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the PR, looks good - just some comments on coding style
src/world/WorldServer.cpp
Outdated
@@ -144,6 +144,11 @@ std::string readFileToString( const std::string& filename ) | |||
// Close the file | |||
file.close(); | |||
|
|||
// Remove all newlines from the file contents | |||
fileContents.erase(std::remove(fileContents.begin(), fileContents.end(), '\n'), fileContents.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use whitespaces within parentheses
-> fileContents.erase( std::remove( fileContents.begin(), fileContents.end(), '\n' ), fileContents.end() );
src/world/WorldServer.cpp
Outdated
@@ -144,6 +144,11 @@ std::string readFileToString( const std::string& filename ) | |||
// Close the file | |||
file.close(); | |||
|
|||
// Remove all newlines from the file contents | |||
fileContents.erase(std::remove(fileContents.begin(), fileContents.end(), '\n'), fileContents.end()); | |||
fileContents.erase(std::remove(fileContents.begin(), fileContents.end(), '\r'), fileContents.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Some bug fixes and very minor refactoring
No description provided.