@@ -47,7 +47,7 @@ public FnExpr(object tag)
4747 }
4848
4949 #endregion
50-
50+
5151 #region Misc
5252
5353 // This naming convention drawn from the Java code.
@@ -61,7 +61,7 @@ internal void ComputeNames(ISeq form, string name)
6161
6262 Symbol nm = RT . second ( form ) as Symbol ;
6363
64- if ( nm != null )
64+ if ( nm != null )
6565 {
6666 name = nm . Name + "__" + RT . nextID ( ) ;
6767 }
@@ -95,7 +95,7 @@ public override Type ClrType
9595 {
9696 get
9797 {
98- if ( _cachedType == null )
98+ if ( _cachedType == null )
9999 _cachedType = _tag != null ? HostExpr . TagToType ( _tag ) : typeof ( AFunction ) ;
100100 return _cachedType ;
101101 }
@@ -109,29 +109,29 @@ public static Expr Parse(ParserContext pcon, ISeq form, string name)
109109 {
110110 ISeq origForm = form ;
111111
112- FnExpr fn = new FnExpr ( Compiler . TagOf ( form ) )
112+ FnExpr fn = new ( Compiler . TagOf ( form ) )
113113 {
114114 Src = form
115115 } ;
116116
117117 Keyword retKey = Keyword . intern ( null , "rettag" ) ; // TODO: make static
118118 object retTag = RT . get ( RT . meta ( form ) , retKey ) ;
119119 ObjMethod enclosingMethod = ( ObjMethod ) Compiler . MethodVar . deref ( ) ;
120- fn . _hasEnclosingMethod = enclosingMethod != null ;
120+ fn . _hasEnclosingMethod = enclosingMethod is not null ;
121121
122122
123- if ( ( ( IMeta ) form . first ( ) ) . meta ( ) != null )
123+ if ( ( ( IMeta ) form . first ( ) ) . meta ( ) is not null )
124124 {
125125 fn . OnceOnly = RT . booleanCast ( RT . get ( RT . meta ( form . first ( ) ) , KW_ONCE ) ) ;
126126 }
127127
128128 fn . ComputeNames ( form , name ) ;
129129
130- List < string > prims = new List < string > ( ) ;
130+ List < string > prims = new ( ) ;
131131
132132 //arglist might be preceded by symbol naming this fn
133- Symbol nm = RT . second ( form ) as Symbol ;
134- if ( nm != null )
133+ Symbol nm = RT . second ( form ) as Symbol ;
134+ if ( nm is not null )
135135 {
136136 fn . ThisName = nm . Name ;
137137 form = RT . cons ( Compiler . FnSym , RT . next ( RT . next ( form ) ) ) ;
@@ -162,14 +162,14 @@ public static Expr Parse(ParserContext pcon, ISeq form, string name)
162162 Compiler . ProtocolCallsitesVar , PersistentVector . EMPTY ,
163163 Compiler . VarCallsitesVar , Compiler . EmptyVarCallSites ( ) ,
164164 Compiler . NoRecurVar , null ) ) ;
165- SortedDictionary < int , FnMethod > methods = new SortedDictionary < int , FnMethod > ( ) ;
165+ SortedDictionary < int , FnMethod > methods = new ( ) ;
166166 FnMethod variadicMethod = null ;
167167 bool usesThis = false ;
168168
169169 for ( ISeq s = RT . next ( form ) ; s != null ; s = RT . next ( s ) )
170170 {
171171 FnMethod f = FnMethod . Parse ( fn , ( ISeq ) RT . first ( s ) , retTag ) ;
172- if ( f . UsesThis )
172+ if ( f . UsesThis )
173173 {
174174 //Console.WriteLine("{0} uses this",fn.Name);
175175 usesThis = true ;
@@ -200,17 +200,17 @@ public static Expr Parse(ParserContext pcon, ISeq form, string name)
200200 if ( variadicMethod != null )
201201 allMethods = RT . conj ( allMethods , variadicMethod ) ;
202202
203- if ( fn . CanBeDirect )
203+ if ( fn . CanBeDirect )
204204 {
205205 for ( ISeq s = RT . seq ( allMethods ) ; s != null ; s = s . next ( ) )
206206 {
207207 FnMethod fm = s . first ( ) as FnMethod ;
208- if ( fm . Locals != null )
208+ if ( fm . Locals != null )
209209 {
210210 for ( ISeq sl = RT . seq ( RT . keys ( fm . Locals ) ) ; sl != null ; sl = sl . next ( ) )
211211 {
212212 LocalBinding lb = sl . first ( ) as LocalBinding ;
213- if ( lb . IsArg )
213+ if ( lb . IsArg )
214214 lb . Index -= 1 ;
215215 }
216216 }
@@ -266,7 +266,7 @@ public static Expr Parse(ParserContext pcon, ISeq form, string name)
266266
267267 internal void AddMethod ( FnMethod method )
268268 {
269- Methods = RT . conj ( Methods , method ) ;
269+ Methods = RT . conj ( Methods , method ) ;
270270 }
271271
272272
@@ -282,20 +282,20 @@ internal void AddMethod(FnMethod method)
282282 //static readonly MethodInfo Method_FnExpr_GetDynMethod = typeof(FnExpr).GetMethod("GetDynMethod");
283283 //static readonly MethodInfo Method_FnExpr_GetCompiledConstants = typeof(FnExpr).GetMethod("GetCompiledConstants");
284284
285- static readonly Dictionary < int , Dictionary < int , DynamicMethod > > DynMethodMap = new Dictionary < int , Dictionary < int , DynamicMethod > > ( ) ;
286- static readonly Dictionary < int , object [ ] > ConstantsMap = new Dictionary < int , object [ ] > ( ) ;
285+ static readonly Dictionary < int , Dictionary < int , DynamicMethod > > DynMethodMap = new ( ) ;
286+ static readonly Dictionary < int , object [ ] > ConstantsMap = new ( ) ;
287287
288288 public static DynamicMethod GetDynMethod ( int key , int arity )
289289 {
290290 DynamicMethod dm = DynMethodMap [ key ] [ arity ] ;
291291 if ( dm == null )
292292 Console . WriteLine ( "Bad dynmeth retrieval" ) ;
293293 return dm ;
294- // Dictionary<int, WeakReference > dict = DynMethodMap[key];
295- // WeakReference wr = dict[arity];
296- // return (DynamicMethod)wr.Target;
294+ // Dictionary<int, WeakReference > dict = DynMethodMap[key];
295+ // WeakReference wr = dict[arity];
296+ // return (DynamicMethod)wr.Target;
297297 }
298-
298+
299299 public static object [ ] GetCompiledConstants ( int key )
300300 {
301301 return ConstantsMap [ key ] ;
@@ -354,7 +354,7 @@ protected override void EmitMethods(TypeBuilder tb)
354354 if ( IsVariadic )
355355 EmitGetRequiredArityMethod ( TypeBuilder , _variadicMethod . RequiredArity ) ;
356356
357- List < int > supportedArities = new List < int > ( ) ;
357+ List < int > supportedArities = new ( ) ;
358358 for ( ISeq s = RT . seq ( Methods ) ; s != null ; s = s . next ( ) )
359359 {
360360 FnMethod method = ( FnMethod ) s . first ( ) ;
@@ -372,7 +372,7 @@ static void EmitGetRequiredArityMethod(TypeBuilder tb, int requiredArity)
372372 typeof ( int ) ,
373373 Type . EmptyTypes ) ;
374374
375- CljILGen gen = new CljILGen ( mb . GetILGenerator ( ) ) ;
375+ CljILGen gen = new ( mb . GetILGenerator ( ) ) ;
376376 gen . EmitInt ( requiredArity ) ;
377377 gen . Emit ( OpCodes . Ret ) ;
378378 }
0 commit comments