866 {
868
869 int i;
870 int index_min = 0;
871 int index_max = list.Count() - 1;
872 int target_index = Math.Floor( index_max / 2 );
873
874 if ( index_max == -1 )
875 {
876 list.Insert( entry );
877 return 0;
878 }
879
881 {
883
884 while ( true )
885 {
886 string target_value_str = list[target_index].GetValueStr(
ESortType.HOST);
887
888 if ( entry_value_str == target_value_str || ((index_max - index_min) <= 1) )
889 {
890 for ( i = index_min; i <= index_max; i++ )
891 {
892 if ( entry_value_str >= list[i].GetValueStr(
ESortType.HOST) )
893 {
894 list.InsertAt( entry, i );
895 return i;
896 }
897 }
898
899 index_max++;
900 list.InsertAt( entry, index_max );
901 return target_index;
902 }
903 else if ( entry_value_str > target_value_str )
904 {
905 index_max = target_index;
906 target_index = Math.Floor( target_index / 2 );
907 }
908 else if ( entry_value_str < target_value_str )
909 {
910 index_min = target_index;
911 target_index += Math.Floor( (index_max - index_min) / 2 );
912 }
913 }
914 }
915 else
916 {
917 int entry_value_int = entry.
GetValueInt( sort_type );
918
919 while ( true )
920 {
921 int target_value_int = list[target_index].GetValueInt( sort_type );
922
923 if ( entry_value_int == target_value_int || ((index_max - index_min) <= 1) )
924 {
925 for ( i = index_min; i <= index_max; i++ )
926 {
927 if ( entry_value_int >= list[i].GetValueInt( sort_type ) )
928 {
929 list.InsertAt( entry, i );
930 return i;
931 }
932 }
933
934 index_max++;
935 list.InsertAt( entry, index_max );
936 return target_index;
937 }
938 else if ( entry_value_int > target_value_int )
939 {
940 index_max = target_index;
941 target_index = Math.Floor( target_index / 2 );
942 }
943 else if ( entry_value_int < target_value_int )
944 {
945 index_min = target_index;
946 target_index += Math.Floor( (index_max - index_min) / 2 );
947 }
948 }
949 }
950
951 return target_index;
952 }
ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
string GetValueStr(ESortType sort_type)
int GetValueInt(ESortType sort_type)