-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Code cleanup #4184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code cleanup #4184
Conversation
| /** | ||
| * Get the value of the specified user defined variable. This method always | ||
| * returns a value; it returns ValueNull.INSTANCE if the variable doesn't | ||
| * returns a value; it returns ValueNull. INSTANCE if the variable doesn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{@code ValueNull.INSTANCE} or {@linkplain ValueNull#INSTANCE} to avoid such formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I suppose to read it first 😢
| } | ||
| x = (low + high) >>> 1; | ||
| } | ||
| return -(low + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~low
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just retested it with JMH on Java 21 / x86_64, ~ is still faster like in older versions of Java.
|
|
||
| @Override | ||
| public int compare(byte[] one, byte[] two) { | ||
| return Arrays.compare(one, two); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H2 uses Arrays.compareUnsigned() for binary string data types, but octets in SQL and bytes in Java aren't exactly the same thing.
Anyway, it is possible to write a custom data type for MVStore with any comparison rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way I could care less, it is mostly for benchmark testing and comparison with other stores
Supposedly there is no functional changes, apart from support for byte[] as keys and Integers as keys / values in MVMap (not used by H2).