Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8A78F200C37 for ; Sun, 5 Feb 2017 17:51:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 894BD160B59; Sun, 5 Feb 2017 16:51:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 889BA160B48 for ; Sun, 5 Feb 2017 17:51:38 +0100 (CET) Received: (qmail 86687 invoked by uid 500); 5 Feb 2017 16:51:37 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 85977 invoked by uid 99); 5 Feb 2017 16:51:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Feb 2017 16:51:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3CF31E03D1; Sun, 5 Feb 2017 16:51:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Sun, 05 Feb 2017 16:51:59 -0000 Message-Id: <596464cc01514efc8a929f829cb19ad9@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/27] lucenenet git commit: Lucene.Net.Core.Util.ArrayUtil: Added CLSCompliant(false) attribute to Grow and Shrink overloads that accept jagged arrays. Changed (unused) GetHashCode(sbyte[], int, int) method to GetHashCode(byte[], int, int) to make it C archived-at: Sun, 05 Feb 2017 16:51:39 -0000 Lucene.Net.Core.Util.ArrayUtil: Added CLSCompliant(false) attribute to Grow and Shrink overloads that accept jagged arrays. Changed (unused) GetHashCode(sbyte[], int, int) method to GetHashCode(byte[], int, int) to make it CLS compliant. Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/29e65313 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/29e65313 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/29e65313 Branch: refs/heads/api-work Commit: 29e65313d965dba5a89ecdbb3b7aa63f97b6c439 Parents: 0c711c8 Author: Shad Storhaug Authored: Sun Feb 5 19:02:54 2017 +0700 Committer: Shad Storhaug Committed: Sun Feb 5 19:02:54 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Util/ArrayUtil.cs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/29e65313/src/Lucene.Net.Core/Util/ArrayUtil.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Util/ArrayUtil.cs b/src/Lucene.Net.Core/Util/ArrayUtil.cs index 1ca217c..2df630e 100644 --- a/src/Lucene.Net.Core/Util/ArrayUtil.cs +++ b/src/Lucene.Net.Core/Util/ArrayUtil.cs @@ -414,7 +414,8 @@ namespace Lucene.Net.Util } } - public static sbyte[] Grow(sbyte[] array, int minSize) // LUCENENET TODO: remove this overload, mark it non-CLS compliant, or mark internal + [CLSCompliant(false)] + public static sbyte[] Grow(sbyte[] array, int minSize) { Debug.Assert(minSize >= 0, "size must be positive (got " + minSize + "): likely integer overflow?"); if (array.Length < minSize) @@ -537,7 +538,8 @@ namespace Lucene.Net.Util } } - public static int[][] Grow(int[][] array, int minSize) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static int[][] Grow(int[][] array, int minSize) { Debug.Assert(minSize >= 0, "size must be positive (got " + minSize + "): likely integer overflow?"); if (array.Length < minSize) @@ -552,12 +554,14 @@ namespace Lucene.Net.Util } } - public static int[][] Grow(int[][] array) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static int[][] Grow(int[][] array) { return Grow(array, 1 + array.Length); } - public static int[][] Shrink(int[][] array, int targetSize) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static int[][] Shrink(int[][] array, int targetSize) { Debug.Assert(targetSize >= 0, "size must be positive (got " + targetSize + "): likely integer overflow?"); int newSize = GetShrinkSize(array.Length, targetSize, RamUsageEstimator.NUM_BYTES_OBJECT_REF); @@ -573,7 +577,8 @@ namespace Lucene.Net.Util } } - public static float[][] Grow(float[][] array, int minSize) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static float[][] Grow(float[][] array, int minSize) { Debug.Assert(minSize >= 0, "size must be positive (got " + minSize + "): likely integer overflow?"); if (array.Length < minSize) @@ -588,12 +593,14 @@ namespace Lucene.Net.Util } } - public static float[][] Grow(float[][] array) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static float[][] Grow(float[][] array) { return Grow(array, 1 + array.Length); } - public static float[][] Shrink(float[][] array, int targetSize) // LUCENENET TODO: CLS compliance issue + [CLSCompliant(false)] + public static float[][] Shrink(float[][] array, int targetSize) { Debug.Assert(targetSize >= 0, "size must be positive (got " + targetSize + "): likely integer overflow?"); int newSize = GetShrinkSize(array.Length, targetSize, RamUsageEstimator.NUM_BYTES_OBJECT_REF); @@ -627,7 +634,7 @@ namespace Lucene.Net.Util /// Returns hash of bytes in range start (inclusive) to /// end (inclusive) /// - public static int GetHashCode(sbyte[] array, int start, int end) // LUCENENET TODO: chnage to byte ? + public static int GetHashCode(byte[] array, int start, int end) { int code = 0; for (int i = end - 1; i >= start; i--)