Skip to content

Commit

Permalink
Merge branch 'master' of github.com:espertechinc/nesper
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaxx committed Oct 26, 2018
2 parents 5ad3a74 + 9a90677 commit 1940bc7
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 155 deletions.
13 changes: 7 additions & 6 deletions NEsper/NEsper/compat/collections/CompatExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ public static void Fill<T>(this IList<T> listThis, T value)

public static void Fill<T>(this T[] arrayThis, T value)
{
for (var ii = 0; ii < arrayThis.Length; ii++) {
for (var ii = arrayThis.Length - 1; ii >= 0; ii--) {
arrayThis[ii] = value;
}
}

public static void Fill<T>(this T[] arrayThis, Func<T> generator)
{
for (var ii = 0; ii < arrayThis.Length; ii++) {
for (var ii = arrayThis.Length - 1; ii >= 0; ii--) {
arrayThis[ii] = generator.Invoke();
}
}
Expand All @@ -313,11 +313,13 @@ public static void Fill<T>(this T[] arrayThis, Func<int, T> generator)

public static bool IsEqual<T>(this T[] arrayThis, T[] arrayThat)
{
if (arrayThis.Length != arrayThat.Length) {
var arrayThisLength = arrayThis.Length;
var arrayThatLength = arrayThat.Length;
if (arrayThisLength != arrayThatLength) {
return false;
}

for (var ii = 0; ii < arrayThis.Length; ii++) {
for (var ii = 0; ii < arrayThisLength; ii++) {
if (!Equals(arrayThis[ii], arrayThat[ii])) {
return false;
}
Expand Down Expand Up @@ -533,8 +535,7 @@ public static bool IsNotEmpty<T>(this ICollection<T> parameter)
/// <param name="source">The source.</param>
public static void AddAll<T>(this ICollection<T> pthis, IEnumerable<T> source)
{
if (source is IList<T>) {
var asList = (IList<T>) source;
if (source is IList<T> asList) {
var asListCount = asList.Count;
for (var ii = 0; ii < asListCount; ii++) {
pthis.Add(asList[ii]);
Expand Down
Loading

0 comments on commit 1940bc7

Please sign in to comment.