@@ -131,7 +131,7 @@ public IValue Find(string name)
131131 public void Delete ( IValue column )
132132 {
133133 var vtColumn = GetColumnByIIndex ( column ) ;
134- _owner . ForEach ( ( ValueTableRow x ) =>
134+ _owner . ForEach ( ( ValueTableRow x ) =>
135135 {
136136 x . OnOwnerColumnRemoval ( vtColumn ) ;
137137 } ) ;
@@ -156,10 +156,7 @@ public ValueTableColumn FindColumnByName(string name)
156156 return _columns . Find ( column => _namesComparer . Equals ( name , column . Name ) ) ;
157157 }
158158
159- public ValueTableColumn FindColumnByIndex ( int index )
160- {
161- return _columns [ index ] ;
162- }
159+ public ValueTableColumn FindColumnByIndex ( int index ) => _columns [ index ] ;
163160
164161 public IEnumerator < ValueTableColumn > GetEnumerator ( )
165162 {
@@ -176,10 +173,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
176173
177174 public override bool IsIndexed => true ;
178175
179- public override IValue GetIndexedValue ( IValue index )
180- {
181- return GetColumnByIIndex ( index ) ;
182- }
176+ public override IValue GetIndexedValue ( IValue index ) => GetColumnByIIndex ( index ) ;
183177
184178 public override int GetPropertyNumber ( string name )
185179 {
@@ -189,11 +183,8 @@ public override int GetPropertyNumber(string name)
189183 return idx ;
190184 }
191185
192- public override int GetPropCount ( )
193- {
194- return _columns . Count ;
195- }
196-
186+ public override int GetPropCount ( ) => _columns . Count ;
187+
197188 public override string GetPropName ( int propNum )
198189 {
199190 return FindColumnByIndex ( propNum ) . Name ;
@@ -204,39 +195,30 @@ public override IValue GetPropValue(int propNum)
204195 return FindColumnByIndex ( propNum ) ;
205196 }
206197
207- public override bool IsPropWritable ( int propNum )
208- {
209- return false ;
210- }
211-
212- public override bool IsPropReadable ( int propNum )
213- {
214- return true ;
215- }
198+ public override bool IsPropWritable ( int propNum ) => false ;
199+
200+ public override bool IsPropReadable ( int propNum ) => true ;
216201
217202 public ValueTableColumn GetColumnByIIndex ( IValue index )
218203 {
219204 if ( index . SystemType == BasicTypes . String )
220205 {
221- ValueTableColumn Column = FindColumnByName ( index . ToString ( ) ) ;
222- if ( Column == null )
223- throw PropertyAccessException . PropNotFoundException ( index . ToString ( ) ) ;
224- return Column ;
206+ return FindColumnByName ( index . ToString ( ) )
207+ ?? throw PropertyAccessException . PropNotFoundException ( index . ToString ( ) ) ;
225208 }
226209
227210 if ( index . SystemType == BasicTypes . Number )
228211 {
229212 int i_index = Decimal . ToInt32 ( index . AsNumber ( ) ) ;
230213 if ( i_index < 0 || i_index >= Count ( ) )
231- throw RuntimeException . InvalidArgumentValue ( ) ;
214+ throw RuntimeException . IndexOutOfRange ( ) ;
232215
233- ValueTableColumn Column = FindColumnByIndex ( i_index ) ;
234- return Column ;
216+ return FindColumnByIndex ( i_index ) ;
235217 }
236218
237- if ( index is ValueTableColumn )
219+ if ( index is ValueTableColumn column )
238220 {
239- return index as ValueTableColumn ;
221+ return column ;
240222 }
241223
242224 throw RuntimeException . InvalidArgumentType ( ) ;
@@ -253,13 +235,12 @@ public int GetColumnNumericIndex(IValue index)
253235 {
254236 int iIndex = Decimal . ToInt32 ( index . AsNumber ( ) ) ;
255237 if ( iIndex < 0 || iIndex >= Count ( ) )
256- throw RuntimeException . InvalidArgumentValue ( ) ;
238+ throw RuntimeException . IndexOutOfRange ( ) ;
257239
258240 return iIndex ;
259241 }
260242
261- var column = index as ValueTableColumn ;
262- if ( column != null )
243+ if ( index is ValueTableColumn column )
263244 {
264245 return IndexOf ( column ) ;
265246 }
0 commit comments