MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ListAdd

Function ListAdd

engine/Evaluator/express.cpp:455–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455static GameValue ListAdd(const GameState* state, GameValuePar oper1, GameValuePar oper2)
456{
457 // make return object to avoid unneccessary copy
458 GameValue retValue(new GameDataArray);
459 GameArrayType& ret = retValue;
460
461 const GameArrayType& add1 = oper1;
462 const GameArrayType& add2 = oper2;
463 ret.Realloc(add1.Size() + add2.Size());
464
465 for (int i = 0; i < add1.Size(); i++)
466 {
467 ret.Add(add1[i]);
468 }
469 for (int i = 0; i < add2.Size(); i++)
470 {
471 ret.Add(add2[i]);
472 }
473 return retValue;
474}
475
476static GameValue ListSub(const GameState* state, GameValuePar oper1, GameValuePar oper2)
477{

Callers

nothing calls this directly

Calls 3

ReallocMethod · 0.45
SizeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected