MCPcopy Create free account
hub / github.com/anjo76/angelscript / operator+

Function operator+

sdk/tests/test_performance/source/test_string_pooled.cpp:85–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85CScriptString2 *operator+(const CScriptString2 &a, const CScriptString2 &b)
86{
87 if( pool.size() > 0 )
88 {
89 CScriptString2 *str = pool[pool.size()-1];
90 pool.pop_back();
91 str->buffer.resize(a.buffer.length() + b.buffer.length());
92 str->buffer += a.buffer;
93 str->buffer += b.buffer;
94 str->AddRef();
95 return str;
96 }
97
98 // Return a new object as a script handle
99 return new CScriptString2(a.buffer + b.buffer);
100}
101
102class CStringPooledFactory : public asIStringFactory
103{

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
pop_backMethod · 0.45
lengthMethod · 0.45
AddRefMethod · 0.45

Tested by

no test coverage detected