Pass input string by const reference
We're not mutating the string, so it can be const. And we can pass by reference instead of by value to avoid the copy.
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
vector<string> split(string in)
|
||||
vector<string> split(const string &in)
|
||||
{
|
||||
istringstream stream(in);
|
||||
vector<string> parts;
|
||||
|
Reference in New Issue
Block a user