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

Method getIndexFromValue

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

Source from the content-addressed store, hash-verified

155//-----------------------------------------------------------------------------
156
157S32 ArrayObject::getIndexFromValue( const String &value ) const
158{
159 S32 currentIndex = mMax(mCurrentIndex, 0);
160 S32 foundIndex = -1;
161 for ( S32 i = currentIndex; i < mArray.size(); i++ )
162 {
163 if ( isEqual( mArray[i].value, value ) )
164 {
165 foundIndex = i;
166 break;
167 }
168 }
169
170 if( foundIndex < 0 )
171 {
172 for ( S32 i = 0; i < currentIndex; i++ )
173 {
174 if ( isEqual( mArray[i].value, value ) )
175 {
176 foundIndex = i;
177 break;
178 }
179 }
180 }
181
182 return foundIndex;
183}
184
185//-----------------------------------------------------------------------------
186

Callers 1

arrayObject.cppFile · 0.80

Calls 3

mMaxFunction · 0.85
isEqualFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected