1
0
Fork 0

Codechange: Explicitly move a few variables to avoid a copy constructor (fixes warning from clang)

pull/7760/head
Charles Pigott 2019-06-29 21:57:26 +01:00
parent 99f5e29484
commit 6378a78817
2 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ public:
break;
}
Lex();
return ret;
return std::move(ret);
}
bool IsEndOfStatement() { return ((_lex._prevtoken == '\n') || (_token == SQUIRREL_EOB) || (_token == '}') || (_token == ';')); }
void OptionalSemicolon()

View File

@ -502,14 +502,14 @@ SQObject SQFuncState::CreateString(const SQChar *s,SQInteger len)
{
SQObjectPtr ns(SQString::Create(_sharedstate,s,len));
_table(_strings)->NewSlot(ns,(SQInteger)1);
return ns;
return std::move(ns);
}
SQObject SQFuncState::CreateTable()
{
SQObjectPtr nt(SQTable::Create(_sharedstate,0));
_table(_strings)->NewSlot(nt,(SQInteger)1);
return nt;
return std::move(nt);
}
SQFunctionProto *SQFuncState::BuildProto()