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 DCC78200C20 for ; Sat, 4 Feb 2017 21:32:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DB7B9160B66; Sat, 4 Feb 2017 20:32:25 +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 398B8160B63 for ; Sat, 4 Feb 2017 21:32:25 +0100 (CET) Received: (qmail 98027 invoked by uid 500); 4 Feb 2017 20:32:21 -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 96909 invoked by uid 99); 4 Feb 2017 20:32:20 -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; Sat, 04 Feb 2017 20:32:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8D1ACE0434; Sat, 4 Feb 2017 20:32:20 +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: Sat, 04 Feb 2017 20:32:48 -0000 Message-Id: <1a8c5e8766454844a8f3115995f77b96@git.apache.org> In-Reply-To: <4b623b494bc34c2780b01bf40ded92c7@git.apache.org> References: <4b623b494bc34c2780b01bf40ded92c7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/39] lucenenet git commit: Lucene.Net.Analysis.Util.OpenStringBuilder refactor: Removed Count property which was formerly size() - we already have a Length property. And since StringBuilder uses Length, that one is preferred. archived-at: Sat, 04 Feb 2017 20:32:26 -0000 Lucene.Net.Analysis.Util.OpenStringBuilder refactor: Removed Count property which was formerly size() - we already have a Length property. And since StringBuilder uses Length, that one is preferred. Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4e209cdc Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4e209cdc Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4e209cdc Branch: refs/heads/api-work Commit: 4e209cdc56eb94bf641629af36faf1c2641a3be6 Parents: e3efbd0 Author: Shad Storhaug Authored: Sun Feb 5 01:32:15 2017 +0700 Committer: Shad Storhaug Committed: Sun Feb 5 01:32:15 2017 +0700 ---------------------------------------------------------------------- .../Analysis/En/KStemmer.cs | 2 +- .../Analysis/Util/OpenStringBuilder.cs | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4e209cdc/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs index 250af5b..9173a2a 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs @@ -778,7 +778,7 @@ namespace Lucene.Net.Analysis.En // thisLookup); } else { // System.out.println("new lookup:" + thisLookup); // } - matchedEntry = dict_ht.Get(word.Array, 0, word.Count); + matchedEntry = dict_ht.Get(word.Array, 0, word.Length); return matchedEntry != null; } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4e209cdc/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs index fc73055..b930b3f 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs @@ -69,11 +69,12 @@ namespace Lucene.Net.Analysis.Util } } - // LUCENENE TODO: Change to Length (StringBuilder uses Length in .NET) - public virtual int Count // LUCENENET NOTE: This was size() in Lucene. - { - get{ return m_len; } - } + // LUCENENE NOTE: This is essentially a duplicate of Length (except that property can be set). + // .NET uses Length for StringBuilder anyway, so that property is preferable to this one. + //public virtual int Count // LUCENENET NOTE: This was size() in Lucene. + //{ + // get{ return m_len; } + //} public virtual int Capacity { @@ -142,7 +143,7 @@ namespace Lucene.Net.Analysis.Util protected virtual void Resize(int len) { char[] newbuf = new char[Math.Max(m_buf.Length << 1, len)]; - System.Array.Copy(m_buf, 0, newbuf, 0, Count); + System.Array.Copy(m_buf, 0, newbuf, 0, Length); m_buf = newbuf; } @@ -202,14 +203,14 @@ namespace Lucene.Net.Analysis.Util public virtual char[] ToCharArray() { - char[] newbuf = new char[Count]; - System.Array.Copy(m_buf, 0, newbuf, 0, Count); + char[] newbuf = new char[Length]; + System.Array.Copy(m_buf, 0, newbuf, 0, Length); return newbuf; } public override string ToString() { - return new string(m_buf, 0, Count); + return new string(m_buf, 0, Length); } } } \ No newline at end of file