@@ -95,7 +95,7 @@ public SmartFormatter AddExtensions(params ISource[] sourceExtensions)
9595 _ = InsertExtension ( index , source ) ;
9696
9797 // Also add the class as a formatter, if possible
98- if ( source is IFormatter formatter && FormatterExtensions . All ( fx => fx . GetType ( ) != formatter . GetType ( ) ) ) AddExtensions ( formatter ) ;
98+ if ( source is IFormatter formatter && FormatterExtensions . TrueForAll ( fx => fx . GetType ( ) != formatter . GetType ( ) ) ) AddExtensions ( formatter ) ;
9999 }
100100
101101 return this ;
@@ -123,7 +123,7 @@ public SmartFormatter AddExtensions(params IFormatter[] formatterExtensions)
123123 _ = InsertExtension ( index , formatter ) ;
124124
125125 // Also add the class as a source, if possible
126- if ( formatter is ISource source && SourceExtensions . All ( sx => sx . GetType ( ) != source . GetType ( ) ) ) AddExtensions ( source ) ;
126+ if ( formatter is ISource source && SourceExtensions . TrueForAll ( sx => sx . GetType ( ) != source . GetType ( ) ) ) AddExtensions ( source ) ;
127127 }
128128
129129 return this ;
@@ -144,7 +144,7 @@ public SmartFormatter AddExtensions(params IFormatter[] formatterExtensions)
144144 /// </exception>
145145 public SmartFormatter InsertExtension ( int position , ISource sourceExtension )
146146 {
147- if ( _sourceExtensions . Any ( sx => sx . GetType ( ) == sourceExtension . GetType ( ) ) ) return this ;
147+ if ( _sourceExtensions . Exists ( sx => sx . GetType ( ) == sourceExtension . GetType ( ) ) ) return this ;
148148
149149 if ( sourceExtension is IInitializer sourceToInitialize )
150150 sourceToInitialize . Initialize ( this ) ;
@@ -169,10 +169,10 @@ public SmartFormatter InsertExtension(int position, ISource sourceExtension)
169169 /// </exception>
170170 public SmartFormatter InsertExtension ( int position , IFormatter formatterExtension )
171171 {
172- if ( _formatterExtensions . Any ( sx => sx . GetType ( ) == formatterExtension . GetType ( ) ) ) return this ;
172+ if ( _formatterExtensions . Exists ( sx => sx . GetType ( ) == formatterExtension . GetType ( ) ) ) return this ;
173173
174174 // Extension name is in use by a different type
175- if ( _formatterExtensions . Any ( fx => fx . Name . Equals ( formatterExtension . Name ) ) )
175+ if ( _formatterExtensions . Exists ( fx => fx . Name . Equals ( formatterExtension . Name ) ) )
176176 throw new ArgumentException ( $ "Formatter '{ formatterExtension . GetType ( ) . Name } ' uses existing name.", nameof ( formatterExtension ) ) ;
177177
178178 if ( formatterExtension is IInitializer formatterToInitialize )
0 commit comments