1277 {
1279
1280 int i;
1281 int index_min = 0;
1282 int index_max = list.Count() - 1;
1283 int target_index = Math.Floor( index_max / 2 );
1284
1285 if ( index_max == -1 )
1286 {
1287 list.Insert( entry );
1288 return 0;
1289 }
1290
1292 {
1294
1295 while ( true )
1296 {
1297 string target_value_str = list[target_index].GetValueStr(
ESortType.HOST);
1298
1299 if ( entry_value_str == target_value_str || ((index_max - index_min) <= 1) )
1300 {
1301 for ( i = index_min; i <= index_max; i++ )
1302 {
1303 if ( entry_value_str >= list[i].GetValueStr(
ESortType.HOST) )
1304 {
1305 list.InsertAt( entry, i );
1306 return i;
1307 }
1308 }
1309
1310 index_max++;
1311 list.InsertAt( entry, index_max );
1312 return target_index;
1313 }
1314 else if ( entry_value_str > target_value_str )
1315 {
1316 index_max = target_index;
1317 target_index = Math.Floor( target_index / 2 );
1318 }
1319 else if ( entry_value_str < target_value_str )
1320 {
1321 index_min = target_index;
1322 target_index += Math.Floor( (index_max - index_min) / 2 );
1323 }
1324 }
1325 }
1326 else
1327 {
1328 int entry_value_int = entry.
GetValueInt( sort_type );
1329
1330 while ( true )
1331 {
1332 int target_value_int = list[target_index].GetValueInt( sort_type );
1333
1334 if ( entry_value_int == target_value_int || ((index_max - index_min) <= 1) )
1335 {
1336 for ( i = index_min; i <= index_max; i++ )
1337 {
1338 if ( entry_value_int >= list[i].GetValueInt( sort_type ) )
1339 {
1340 list.InsertAt( entry, i );
1341 return i;
1342 }
1343 }
1344
1345 index_max++;
1346 list.InsertAt( entry, index_max );
1347 return target_index;
1348 }
1349 else if ( entry_value_int > target_value_int )
1350 {
1351 index_max = target_index;
1352 target_index = Math.Floor( target_index / 2 );
1353 }
1354 else if ( entry_value_int < target_value_int )
1355 {
1356 index_min = target_index;
1357 target_index += Math.Floor( (index_max - index_min) / 2 );
1358 }
1359 }
1360 }
1361
1362 return target_index;
1363 }
ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
string GetValueStr(ESortType sort_type)
int GetValueInt(ESortType sort_type)