Make std::string-using script funcs pass around const references

This makes it so that whenever a string is passed into these functions,
it's no longer needlessly copied.
This commit is contained in:
Misa
2020-07-04 16:01:35 -07:00
committed by Ethan Lee
parent d480c1011c
commit e6f3dab2e1
3 changed files with 7 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ void scriptclass::clearcustom(){
customscripts.clear();
}
void scriptclass::tokenize( std::string t )
void scriptclass::tokenize( const std::string& t )
{
j = 0;
std::string tempword;
@@ -3725,7 +3725,7 @@ void scriptclass::hardreset()
running = false;
}
void scriptclass::loadcustom(std::string t)
void scriptclass::loadcustom(const std::string& t)
{
//this magic function breaks down the custom script and turns into real scripting!
std::string cscriptname="";