Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IndexOfOrdinalIgnoreCaseHelper()

unsafe int System.Globalization.CompareInfo.IndexOfOrdinalIgnoreCaseHelper ( ReadOnlySpan< char > source,
ReadOnlySpan< char > target,
CompareOptions options,
int * matchLengthPtr,
bool fromBeginning )
inlineprivate

Definition at line 1155 of file CompareInfo.cs.

1156 {
1157 fixed (char* ptr = &MemoryMarshal.GetReference(source))
1158 {
1159 fixed (char* ptr3 = &MemoryMarshal.GetReference(target))
1160 {
1161 char* ptr2 = ptr;
1162 char* ptr4 = ptr3;
1163 int num = 0;
1164 while (true)
1165 {
1166 if (num < target.Length)
1167 {
1168 char c = ptr4[num];
1169 if (c >= '\u0080' || HighCharTable[c])
1170 {
1171 break;
1172 }
1173 num++;
1174 continue;
1175 }
1176 if (target.Length > source.Length)
1177 {
1178 int num2 = 0;
1179 while (true)
1180 {
1181 if (num2 < source.Length)
1182 {
1183 char c2 = ptr2[num2];
1184 if (c2 >= '\u0080' || HighCharTable[c2])
1185 {
1186 break;
1187 }
1188 num2++;
1189 continue;
1190 }
1191 return -1;
1192 }
1193 break;
1194 }
1195 int num3;
1196 int num4;
1197 int num5;
1198 if (fromBeginning)
1199 {
1200 num3 = 0;
1202 num5 = 1;
1203 }
1204 else
1205 {
1206 num3 = source.Length - target.Length;
1207 num4 = -1;
1208 num5 = -1;
1209 }
1210 int num6 = num3;
1211 while (true)
1212 {
1213 int num8;
1214 if (num6 != num4)
1215 {
1216 int num7 = 0;
1217 num8 = num6;
1218 while (true)
1219 {
1220 if (num7 < target.Length)
1221 {
1222 char c3 = ptr2[num8];
1223 char c4 = ptr4[num7];
1224 if (c3 >= '\u0080' || HighCharTable[c3])
1225 {
1226 break;
1227 }
1228 if (c3 == c4)
1229 {
1230 goto IL_0184;
1231 }
1232 if ((uint)(c3 - 97) <= 25u)
1233 {
1234 c3 = (char)(c3 - 32);
1235 }
1236 if ((uint)(c4 - 97) <= 25u)
1237 {
1238 c4 = (char)(c4 - 32);
1239 }
1240 if (c3 == c4)
1241 {
1242 goto IL_0184;
1243 }
1244 goto IL_0163;
1245 }
1246 if (num8 < source.Length && ptr2[num8] >= '\u0080')
1247 {
1248 break;
1249 }
1250 if (matchLengthPtr != null)
1251 {
1252 *matchLengthPtr = target.Length;
1253 }
1254 return num6;
1255 IL_0184:
1256 num7++;
1257 num8++;
1258 }
1259 break;
1260 }
1261 return -1;
1262 IL_0163:
1263 if (num8 < source.Length - 1 && (ptr2 + num8)[1] >= '\u0080')
1264 {
1265 break;
1266 }
1267 num6 += num5;
1268 }
1269 break;
1270 }
1271 if (fromBeginning)
1272 {
1274 }
1276 }
1277 }
1278 }
static unsafe int IndexOf(IntPtr sortHandle, char *target, int cwTargetLength, char *pSource, int cwSourceLength, CompareOptions options, int *matchLengthPtr)
static unsafe int LastIndexOf(IntPtr sortHandle, char *target, int cwTargetLength, char *pSource, int cwSourceLength, CompareOptions options, int *matchLengthPtr)
static ReadOnlySpan< bool > HighCharTable

References System.Globalization.CompareInfo._sortHandle, System.Runtime.Serialization.Dictionary, System.Globalization.CompareInfo.HighCharTable, Interop.Globalization.IndexOf(), Interop.Globalization.LastIndexOf(), System.options, and System.source.

Referenced by System.Globalization.CompareInfo.IcuIndexOfCore().