MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / sort

Method sort

Engine/source/console/arrayObject.cpp:471–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469//-----------------------------------------------------------------------------
470
471void ArrayObject::sort( bool valsort, bool asc, bool numeric )
472{
473 if ( mArray.size() <= 1 )
474 return;
475
476 smDecreasing = asc ? false : true;
477 smCaseSensitive = isCaseSensitive();
478
479 if ( numeric )
480 {
481 if ( valsort )
482 dQsort( (void *)&(mArray[0]), mArray.size(), sizeof(Element), _valueNumCompare) ;
483 else
484 dQsort( (void *)&(mArray[0]), mArray.size(), sizeof(Element), _keyNumCompare );
485 }
486 else
487 {
488 if( valsort )
489 dQsort( (void *)&(mArray[0]), mArray.size(), sizeof(Element), _valueCompare );
490 else
491 dQsort( (void *)&(mArray[0]), mArray.size(), sizeof(Element), _keyCompare );
492 }
493}
494
495//-----------------------------------------------------------------------------
496

Callers 1

arrayObject.cppFile · 0.45

Calls 3

isCaseSensitiveFunction · 0.85
dQsortFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected