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

◆ Create()

static Instruction System.Linq.Expressions.Interpreter.LessThanInstruction.Create ( Type type,
bool liftedToNull = false )
inlinestaticinherited

Definition at line 317 of file LessThanInstruction.cs.

318 {
319 if (liftedToNull)
320 {
321 return type.GetNonNullableType().GetTypeCode() switch
322 {
323 TypeCode.SByte => s_liftedToNullSByte ?? (s_liftedToNullSByte = new LessThanSByte(null)),
324 TypeCode.Int16 => s_liftedToNullInt16 ?? (s_liftedToNullInt16 = new LessThanInt16(null)),
325 TypeCode.Char => s_liftedToNullChar ?? (s_liftedToNullChar = new LessThanChar(null)),
326 TypeCode.Int32 => s_liftedToNullInt32 ?? (s_liftedToNullInt32 = new LessThanInt32(null)),
327 TypeCode.Int64 => s_liftedToNullInt64 ?? (s_liftedToNullInt64 = new LessThanInt64(null)),
328 TypeCode.Byte => s_liftedToNullByte ?? (s_liftedToNullByte = new LessThanByte(null)),
329 TypeCode.UInt16 => s_liftedToNullUInt16 ?? (s_liftedToNullUInt16 = new LessThanUInt16(null)),
330 TypeCode.UInt32 => s_liftedToNullUInt32 ?? (s_liftedToNullUInt32 = new LessThanUInt32(null)),
331 TypeCode.UInt64 => s_liftedToNullUInt64 ?? (s_liftedToNullUInt64 = new LessThanUInt64(null)),
332 TypeCode.Single => s_liftedToNullSingle ?? (s_liftedToNullSingle = new LessThanSingle(null)),
333 TypeCode.Double => s_liftedToNullDouble ?? (s_liftedToNullDouble = new LessThanDouble(null)),
334 _ => throw ContractUtils.Unreachable,
335 };
336 }
337 return type.GetNonNullableType().GetTypeCode() switch
338 {
339 TypeCode.SByte => s_SByte ?? (s_SByte = new LessThanSByte(Utils.BoxedFalse)),
340 TypeCode.Int16 => s_Int16 ?? (s_Int16 = new LessThanInt16(Utils.BoxedFalse)),
341 TypeCode.Char => s_Char ?? (s_Char = new LessThanChar(Utils.BoxedFalse)),
342 TypeCode.Int32 => s_Int32 ?? (s_Int32 = new LessThanInt32(Utils.BoxedFalse)),
343 TypeCode.Int64 => s_Int64 ?? (s_Int64 = new LessThanInt64(Utils.BoxedFalse)),
344 TypeCode.Byte => s_Byte ?? (s_Byte = new LessThanByte(Utils.BoxedFalse)),
345 TypeCode.UInt16 => s_UInt16 ?? (s_UInt16 = new LessThanUInt16(Utils.BoxedFalse)),
346 TypeCode.UInt32 => s_UInt32 ?? (s_UInt32 = new LessThanUInt32(Utils.BoxedFalse)),
347 TypeCode.UInt64 => s_UInt64 ?? (s_UInt64 = new LessThanUInt64(Utils.BoxedFalse)),
348 TypeCode.Single => s_Single ?? (s_Single = new LessThanSingle(Utils.BoxedFalse)),
349 TypeCode.Double => s_Double ?? (s_Double = new LessThanDouble(Utils.BoxedFalse)),
350 _ => throw ContractUtils.Unreachable,
351 };
352 }

References System.Linq.Expressions.Utils.BoxedFalse, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Byte, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Char, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Double, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Int16, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Int32, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Int64, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullByte, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullChar, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullDouble, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullInt16, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullInt32, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullInt64, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullSByte, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullSingle, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullUInt16, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullUInt32, System.Linq.Expressions.Interpreter.LessThanInstruction.s_liftedToNullUInt64, System.Linq.Expressions.Interpreter.LessThanInstruction.s_SByte, System.Linq.Expressions.Interpreter.LessThanInstruction.s_Single, System.Linq.Expressions.Interpreter.LessThanInstruction.s_UInt16, System.Linq.Expressions.Interpreter.LessThanInstruction.s_UInt32, System.Linq.Expressions.Interpreter.LessThanInstruction.s_UInt64, System.type, and System.Dynamic.Utils.ContractUtils.Unreachable.

Referenced by System.Linq.Expressions.Interpreter.InstructionList.EmitLessThan().