You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/11/10 02:56:08 UTC

[GitHub] [lucene-solr] msokolov commented on a change in pull request #2071: LUCENE-9322: Some fixes to SimpleTextVectorFormat.

msokolov commented on a change in pull request #2071:
URL: https://github.com/apache/lucene-solr/pull/2071#discussion_r520253512



##########
File path: lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextVectorReader.java
##########
@@ -245,8 +245,8 @@ private void readAllVectors() throws IOException {
 
     private void readVector(float[] value) throws IOException {
       SimpleTextUtil.readLine(in, scratch);
-      // skip leading " [" and strip trailing "]"
-      String s = new BytesRef(scratch.bytes(), 2, scratch.length() - 3).utf8ToString();
+      // skip leading "[" and strip trailing "]"
+      String s = new BytesRef(scratch.bytes(), 1, scratch.length() - 2).utf8ToString();

Review comment:
       Wow, how did this ever work; we must never have tested it. grr. Thank you for cleaning up!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org