]> git.bitcoin.ninja Git - ldk-java/commitdiff
[C#] Make check_arr_len generic across array types
authorMatt Corallo <git@bluematt.me>
Thu, 7 Sep 2023 16:20:31 +0000 (16:20 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 7 Sep 2023 16:20:31 +0000 (16:20 +0000)
c_sharp/src/org/ldk/util/InternalUtils.cs

index 620b3b3db493bc67556c78f22c76e078b0a39f0e..214420a8bd249af0f252da43b43f4953f118fe7b 100644 (file)
@@ -2,7 +2,7 @@ using System;
 using org.ldk.util;
 
 internal class InternalUtils {
-       public static byte[] check_arr_len(byte[] arr, int length) {
+       public static T[] check_arr_len<T>(T[] arr, int length) {
                if (arr != null && arr.Length != length) {
                        throw new ArgumentException("Array must be of fixed size " + length + " but was of length " + arr.Length);
                }