Fixes casting checks
This commit is contained in:
parent
7ea00fbf4f
commit
03dd5f1926
431 changed files with 5616 additions and 6250 deletions
|
|
@ -107,8 +107,8 @@ namespace Server.Commands.Generic
|
|||
|
||||
ext.Parse( from, args, i + 1, size - i - 1 );
|
||||
|
||||
if ( ext is WhereExtension )
|
||||
baseType = ( ext as WhereExtension ).Conditional.Type;
|
||||
if ( ext is WhereExtension extension )
|
||||
baseType = extension.Conditional.Type;
|
||||
|
||||
parsed.Add( ext );
|
||||
|
||||
|
|
|
|||
|
|
@ -87,22 +87,22 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( m_Value is int )
|
||||
method.Load( (int) m_Value );
|
||||
else if ( m_Value is long )
|
||||
method.Load( (long) m_Value );
|
||||
else if ( m_Value is float )
|
||||
method.Load( (float) m_Value );
|
||||
else if ( m_Value is double )
|
||||
method.Load( (double) m_Value );
|
||||
else if ( m_Value is char )
|
||||
method.Load( (char) m_Value );
|
||||
else if ( m_Value is bool )
|
||||
method.Load( (bool) m_Value );
|
||||
else if ( m_Value is string )
|
||||
method.Load( (string) m_Value );
|
||||
else if ( m_Value is Enum )
|
||||
method.Load( (Enum) m_Value );
|
||||
if ( m_Value is int i )
|
||||
method.Load( i );
|
||||
else if ( m_Value is long l )
|
||||
method.Load( l );
|
||||
else if ( m_Value is float f )
|
||||
method.Load( f );
|
||||
else if ( m_Value is double d )
|
||||
method.Load( d );
|
||||
else if ( m_Value is char c )
|
||||
method.Load( c );
|
||||
else if ( m_Value is bool b )
|
||||
method.Load( b );
|
||||
else if ( m_Value is string s )
|
||||
method.Load( s );
|
||||
else if ( m_Value is Enum e )
|
||||
method.Load( e );
|
||||
else
|
||||
throw new InvalidOperationException( "Unrecognized comparison value." );
|
||||
}
|
||||
|
|
@ -110,10 +110,8 @@ namespace Server.Commands.Generic
|
|||
|
||||
public void Acquire( TypeBuilder typeBuilder, ILGenerator il, string fieldName )
|
||||
{
|
||||
if ( m_Value is string )
|
||||
if ( m_Value is string toParse )
|
||||
{
|
||||
string toParse = (string) m_Value;
|
||||
|
||||
if ( !m_Type.IsValueType && toParse == "null" )
|
||||
{
|
||||
m_Value = null;
|
||||
|
|
@ -391,7 +389,7 @@ namespace Server.Commands.Generic
|
|||
bool inverse = false;
|
||||
|
||||
bool couldCompare =
|
||||
emitter.CompareTo( 1, delegate()
|
||||
emitter.CompareTo( 1, delegate
|
||||
{
|
||||
m_Value.Load( emitter );
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace Server.Commands.Generic
|
|||
emitter.Chain( prop );
|
||||
|
||||
bool couldCompare =
|
||||
emitter.CompareTo( 1, delegate()
|
||||
emitter.CompareTo( 1, delegate
|
||||
{
|
||||
emitter.LoadLocal( b );
|
||||
emitter.Chain( prop );
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace Server.Commands.Generic
|
|||
emitter.Chain( prop );
|
||||
|
||||
bool couldCompare =
|
||||
emitter.CompareTo( sign, delegate()
|
||||
emitter.CompareTo( sign, delegate
|
||||
{
|
||||
emitter.LoadLocal( b );
|
||||
emitter.Chain( prop );
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
public sealed class DistinctExtension : BaseExtension
|
||||
{
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 30, "Distinct", -1, delegate() { return new DistinctExtension(); } );
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 30, "Distinct", -1, delegate { return new DistinctExtension(); } );
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
public sealed class LimitExtension : BaseExtension
|
||||
{
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 80, "Limit", 1, delegate() { return new LimitExtension(); } );
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 80, "Limit", 1, delegate { return new LimitExtension(); } );
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
public sealed class SortExtension : BaseExtension
|
||||
{
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 40, "Order", -1, delegate() { return new SortExtension(); } );
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 40, "Order", -1, delegate { return new SortExtension(); } );
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Server.Commands.Generic
|
|||
{
|
||||
public sealed class WhereExtension : BaseExtension
|
||||
{
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 20, "Where", -1, delegate() { return new WhereExtension(); } );
|
||||
public static ExtensionInfo ExtInfo = new ExtensionInfo( 20, "Where", -1, delegate { return new WhereExtension(); } );
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue