MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / fromInt

Function fromInt

src/Dynamic.cpp:341–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339Dynamic sConstDynamicInts[256+1];
340
341static hx::Object *fromInt(int inVal)
342{
343 hx::Object *result = 0;
344 if (inVal>=-1 && inVal<256)
345 {
346 int idx = inVal+1;
347 result = sConstDynamicInts[idx].mPtr;
348 if (!result)
349 result = sConstDynamicInts[idx].mPtr = new (hx::NewObjConst)IntData(inVal);
350 }
351 else
352 result = (hx::Object *)new IntData(inVal);
353 return result;
354}
355
356Dynamic::Dynamic(bool inVal) : super( inVal ? hx::DynTrue.mPtr : hx::DynFalse.mPtr ) { }
357

Callers 3

StringMethod · 0.85
DynamicMethod · 0.85
StringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected