@@ -246,7 +246,7 @@ public static T[] CopyNonEmpty<T>(this T[] source)
246246 return copy ;
247247 }
248248
249- /// <summary>Returns the new array consisting from all items from source array then the all items from added array.
249+ /// <summary>Returns the new array consisting of all items from source array then the all items from added array.
250250 /// If source is null or empty then the added array will be returned. If added is null or empty then the source will be returned.</summary>
251251 public static T [ ] Append < T > ( this T [ ] source , params T [ ] added )
252252 {
@@ -402,7 +402,6 @@ public static int IndexOf<T>(this T[] source, T value)
402402 if ( Equals ( item , value ) )
403403 return i ;
404404 }
405-
406405 return - 1 ;
407406 }
408407
@@ -446,7 +445,6 @@ public static T FindFirst<T>(this T[] source, Func<T, bool> predicate)
446445 if ( predicate ( item ) )
447446 return item ;
448447 }
449-
450448 return default ( T ) ;
451449 }
452450
@@ -460,7 +458,6 @@ public static T FindFirst<T, S>(this T[] source, S state, Func<S, T, bool> predi
460458 if ( predicate ( state , item ) )
461459 return item ;
462460 }
463-
464461 return default ( T ) ;
465462 }
466463
@@ -547,10 +544,8 @@ private static R[] AppendTo<T, R>(T[] source, int sourcePos, int count, Func<T,
547544 if ( count == 1 )
548545 appendedResults [ oldResultsCount ] = map ( source [ sourcePos ] ) ;
549546 else
550- {
551547 for ( int i = oldResultsCount , j = sourcePos ; i < appendedResults . Length ; ++ i , ++ j )
552548 appendedResults [ i ] = map ( source [ j ] ) ;
553- }
554549
555550 return appendedResults ;
556551 }
@@ -578,10 +573,8 @@ private static R[] AppendTo<S, T, R>(T[] source, S state, int sourcePos, int cou
578573 if ( count == 1 )
579574 appendedResults [ oldResultsCount ] = map ( state , source [ sourcePos ] ) ;
580575 else
581- {
582576 for ( int i = oldResultsCount , j = sourcePos ; i < appendedResults . Length ; ++ i , ++ j )
583577 appendedResults [ i ] = map ( state , source [ j ] ) ;
584- }
585578
586579 return appendedResults ;
587580 }
@@ -609,10 +602,8 @@ private static R[] AppendTo<A, B, T, R>(T[] source, A a, B b, int sourcePos, int
609602 if ( count == 1 )
610603 appendedResults [ oldResultsCount ] = map ( a , b , source [ sourcePos ] ) ;
611604 else
612- {
613605 for ( int i = oldResultsCount , j = sourcePos ; i < appendedResults . Length ; ++ i , ++ j )
614606 appendedResults [ i ] = map ( a , b , source [ j ] ) ;
615- }
616607
617608 return appendedResults ;
618609 }
@@ -1256,9 +1247,7 @@ public static int Combine<T1, T2>(T1 a, T2 b)
12561247 if ( ReferenceEquals ( a , null ) )
12571248 return bh ;
12581249 var ah = a . GetHashCode ( ) ;
1259- if ( ah == 0 )
1260- return bh ;
1261- return Combine ( ah , bh ) ;
1250+ return ah == 0 ? bh : Combine ( ah , bh ) ;
12621251 }
12631252
12641253 /// <summary>Inspired by System.Tuple.CombineHashCodes</summary>
@@ -1513,7 +1502,6 @@ public T[] ResizeToArray()
15131502 return items ;
15141503 }
15151504
1516- // todo: @naming think of the better name
15171505 /// <summary>Pops the item - just moving the counter back</summary>
15181506 public T PopItem ( ) => Items [ -- Count ] ;
15191507
@@ -1991,7 +1979,6 @@ internal override Entry AddOrUpdateWithTheSameHashByReferenceEquals(ImHashMapEnt
19911979 return ReferenceEquals ( key , e . _key ) ? ImHashMap . Entry ( Hash , key , update ( key , Value , e . Value ) ) : new HashConflictingEntry ( Hash , this , e ) ;
19921980 }
19931981
1994- // todo: @wip better method names aligned with the calling side
19951982 internal override ImHashMap < K , V > GetMapOrReplaceWithEntry ( ImHashMap < K , V > oldMap , ImHashMapEntry < K , V > newEntry )
19961983 {
19971984 var e = ( KVEntry < K , V > ) newEntry ;
0 commit comments