maedhroz commented on code in PR #2989:
URL: https://github.com/apache/cassandra/pull/2989#discussion_r1430339932


##########
src/java/org/apache/cassandra/index/sai/memory/TrieMemoryIndex.java:
##########
@@ -243,35 +238,7 @@ private void setMinMaxTerm(ByteBuffer term)
 
     private ByteComparable asComparableBytes(ByteBuffer input)
     {
-        return isLiteral ? version -> terminated(ByteSource.of(input, version))
-                         : version -> 
index.termType().asComparableBytes(input, version);
-    }
-
-    private ByteComparable decode(ByteComparable term)
-    {
-        return isLiteral ? version -> 
ByteSourceInverse.unescape(ByteSource.peekable(term.asComparableBytes(version)))
-                         : term;
-    }
-
-    private ByteSource terminated(ByteSource src)
-    {
-        return new ByteSource()
-        {
-            boolean done = false;
-
-            @Override
-            public int next()
-            {
-                if (done)
-                    return END_OF_STREAM;
-                int n = src.next();
-                if (n != END_OF_STREAM)
-                    return n;
-
-                done = true;
-                return ByteSource.TERMINATOR;
-            }
-        };
+        return version -> index.termType().asComparableBytes(input, version);

Review Comment:
   So the idea here is that this was never actually necessary for single 
strings, as the purpose of `ByteSource.TERMINATOR` was to make sequences of 
`ByteSource`s prefix-free?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to