MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / getIndexFromKey

Method getIndexFromKey

Engine/source/console/arrayObject.cpp:183–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181//-----------------------------------------------------------------------------
182
183S32 ArrayObject::getIndexFromKey( const String &key ) const
184{
185 S32 foundIndex = -1;
186 for ( S32 i = mCurrentIndex; i < mArray.size(); i++ )
187 {
188 if ( isEqual( mArray[i].key, key ) )
189 {
190 foundIndex = i;
191 break;
192 }
193 }
194
195 if( foundIndex < 0 )
196 {
197 for ( S32 i = 0; i < mCurrentIndex; i++ )
198 {
199 if ( isEqual( mArray[i].key, key ) )
200 {
201 foundIndex = i;
202 break;
203 }
204 }
205 }
206
207 return foundIndex;
208}
209
210//-----------------------------------------------------------------------------
211

Callers 3

EObjectSelectionFunction · 0.80
EObjectSelectionFunction · 0.80
arrayObject.cppFile · 0.80

Calls 2

isEqualFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected