I try to use the CharArraySet for a filter I am writing. I heavily use char-arrays in my code to speed up things. I stumbled upon a bug in CharArraySet while doing that.
The method public boolean contains(char[] text, int off, int len) seems not to work.
When I do
if (set.contains(buffer,offset,length) {
...
}
my code fails.
But when I do
if (set.contains(newString(buffer,offset,length)) {
...
}
everything works as expected.
Both variants should behave the same. I attach a small piece of code to show the problem.
Description
I try to use the CharArraySet for a filter I am writing. I heavily use char-arrays in my code to speed up things. I stumbled upon a bug in CharArraySet while doing that.
The method public boolean contains(char[] text, int off, int len) seems not to work.
When I do
if (set.contains(buffer,offset,length) {
...
}
my code fails.
But when I do
if (set.contains(newString(buffer,offset,length)) {
...
}
everything works as expected.
Both variants should behave the same. I attach a small piece of code to show the problem.