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

Method getIndexFromKey

Engine/source/console/arrayObject.cpp:187–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

arrayObject.cppFile · 0.80

Calls 3

mMaxFunction · 0.85
isEqualFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected