提交 e4791847 authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation / formatting

上级 d5006d2b
......@@ -17,7 +17,7 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Conditions on the "_rowid_" pseudo-column didn't use an index
<ul><li>Issue 579: Conditions on the "_rowid_" pseudo-column didn't use an index
when using the MVStore.
</li><li>Fixed documentation that "offset" and "fetch" are also keywords since version 1.4.x.
</li><li>The Long.MIN_VALUE could not be parsed for auto-increment (identity) columns.
......
......@@ -180,7 +180,8 @@ public class Driver implements java.sql.Driver {
/**
* INTERNAL
* Sets, on a per-thread basis, the default-connection for user-defined functions.
* Sets, on a per-thread basis, the default-connection for
* user-defined functions.
*/
public static void setDefaultConnection(Connection c) {
if (c == null) {
......
......@@ -2986,7 +2986,7 @@ public class Parser {
throw DbException.getSyntaxError(sqlCommand, parseIndex, "integer");
}
if (minus) {
// must do that now, otherwise Integer.MIN_VALUE wouldn't work
// must do that now, otherwise Integer.MIN_VALUE would not work
currentValue = currentValue.negate();
}
int i = currentValue.getInt();
......@@ -3006,7 +3006,7 @@ public class Parser {
throw DbException.getSyntaxError(sqlCommand, parseIndex, "long");
}
if (minus) {
// must do that now, otherwise Long.MIN_VALUE wouldn't work
// must do that now, otherwise Long.MIN_VALUE would not work
currentValue = currentValue.negate();
}
long i = currentValue.getLong();
......
......@@ -224,7 +224,14 @@ public class TestPerfectHash extends TestBase {
*/
static class Text {
/**
* The byte data (may be shared, so must not be modified).
*/
final byte[] data;
/**
* The start location.
*/
final int start;
Text(byte[] data, int start) {
......@@ -232,6 +239,13 @@ public class TestPerfectHash extends TestBase {
this.start = start;
}
/**
* The hash code (using a universal hash function).
*
* @param index the hash function index
* @param seed the random seed
* @return the hash code
*/
public int hashCode(int index, int seed) {
if (index < 8) {
int x = (index * 0x9f3b) ^ seed;
......
......@@ -762,4 +762,8 @@ exploit noise ongoing disclaimers shrinks remedy party desirable timely construe
deque synchronizers affero kevent nikolaj hohmuth grajcar jens fogh hostnames
operate resized jni yjp ownable starvation reaper biased introduce epoll hangs
compaction aggressive powerful traversing pietrzak michi karl rewriting consequences
linearly patching perfect hole
linearly patching perfect hole sip enwiki
flooding uniformly recursions happening
......@@ -153,6 +153,7 @@ public class MinimalPerfectHash<K> {
* Create a hash object to convert keys to hashes.
*
* @param desc the data returned by the generate method
* @param hash the universal hash function
*/
public MinimalPerfectHash(byte[] desc, UniversalHash<K> hash) {
this.hash = hash;
......@@ -193,7 +194,8 @@ public class MinimalPerfectHash<K> {
}
/**
* Get the hash value for the given key, starting at a certain position and level.
* Get the hash value for the given key, starting at a certain position and
* level.
*
* @param pos the start position
* @param x the key
......@@ -304,6 +306,7 @@ public class MinimalPerfectHash<K> {
* integers.
*
* @param set the data
* @param hash the universal hash function
* @return the hash function description
*/
public static <K> byte[] generate(Set<K> set, UniversalHash<K> hash) {
......@@ -323,7 +326,9 @@ public class MinimalPerfectHash<K> {
* Generate the perfect hash function data from the given set of integers.
*
* @param list the data, in the form of a list
* @param hash the universal hash function
* @param level the recursion level
* @param seed the random seed
* @param out the output stream
*/
static <K> void generate(ArrayList<K> list, UniversalHash<K> hash,
......@@ -477,7 +482,8 @@ public class MinimalPerfectHash<K> {
* @param size the size of the bucket
* @return the hash (a value between 0, including, and the size, excluding)
*/
private static <K> int hash(K o, UniversalHash<K> hash, int level, int seed, int offset, int size) {
private static <K> int hash(K o, UniversalHash<K> hash, int level,
int seed, int offset, int size) {
int x = hash.hashCode(o, level, seed);
x += level + offset * 16;
x = ((x >>> 16) ^ x) * 0x45d9f3b;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论