You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/04/01 15:33:55 UTC

[GitHub] [accumulo] keith-turner commented on issue #1066: Speed up containKey calls by not always recomputing hashcodes

keith-turner commented on issue #1066: Speed up containKey calls by not always recomputing hashcodes
URL: https://github.com/apache/accumulo/pull/1066#issuecomment-478629148
 
 
   A situation like the following could be problematic because the `toArray()` function may or may not copy.  If it does not copy, then the following code changes the byte sequence but the hashcode does not change.
   
   ```java
   ByteSequence byteSeq = new ArrayByteSequence(new byte[]{8,9});
   System.out.println(byteSeq.hashCode());
   byteSeq.toArray()[0]=3;
   System.out.println(byteSeq.hashCode());
   ```

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


With regards,
Apache Git Services