lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhern...@apache.org
Subject [47/50] [abbrv] git commit: Fix byte count logic
Date Tue, 24 Sep 2013 18:33:23 GMT
Fix byte count logic


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/96a95e35
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/96a95e35
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/96a95e35

Branch: refs/heads/branch_4x
Commit: 96a95e35bf40ee9a3d9a98484f08e7c9ffaca2f0
Parents: 86087f1
Author: Paul Irwin <paulirwin@gmail.com>
Authored: Mon Aug 12 11:30:57 2013 -0400
Committer: Paul Irwin <paulirwin@gmail.com>
Committed: Mon Aug 12 11:30:57 2013 -0400

----------------------------------------------------------------------
 src/contrib/Analyzers/Core/KeywordTokenizer.cs | 2 +-
 src/contrib/Analyzers/Util/CharacterUtils.cs   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/96a95e35/src/contrib/Analyzers/Core/KeywordTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Core/KeywordTokenizer.cs b/src/contrib/Analyzers/Core/KeywordTokenizer.cs
index 83ba155..ecf12df 100644
--- a/src/contrib/Analyzers/Core/KeywordTokenizer.cs
+++ b/src/contrib/Analyzers/Core/KeywordTokenizer.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Analysis.Core
                 while (true)
                 {
                     int length = input.Read(buffer, upto, buffer.Length - upto);
-                    if (length == -1) break;
+                    if (length <= 0) break;
                     upto += length;
                     if (upto == buffer.Length)
                         buffer = termAtt.ResizeBuffer(1 + buffer.Length);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/96a95e35/src/contrib/Analyzers/Util/CharacterUtils.cs
----------------------------------------------------------------------
diff --git a/src/contrib/Analyzers/Util/CharacterUtils.cs b/src/contrib/Analyzers/Util/CharacterUtils.cs
index 5fdc78f..ecb32ba 100644
--- a/src/contrib/Analyzers/Util/CharacterUtils.cs
+++ b/src/contrib/Analyzers/Util/CharacterUtils.cs
@@ -72,7 +72,7 @@ namespace Lucene.Net.Analysis.Util
             {
                 buffer.offset = 0;
                 int read = reader.Read(buffer.buffer, 0, buffer.length);
-                if (read == -1)
+                if (read <= 0)
                     return false;
                 buffer.length = read;
                 return true;


Mime
View raw message