提交 b365737a authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

Optimizer - simplify ifs

上级 a086df3e
...@@ -97,12 +97,9 @@ class Optimizer { ...@@ -97,12 +97,9 @@ class Optimizer {
} }
private boolean canStop(int x) { private boolean canStop(int x) {
if ((x & 127) == 0) { return (x & 127) == 0
long t = System.nanoTime() - startNs; && cost >= 0 // don't calculate for simple queries (no rows or so)
// don't calculate for simple queries (no rows or so) && 10 * (System.nanoTime() - startNs) > cost * TimeUnit.MILLISECONDS.toNanos(1);
return cost >= 0 && 10 * t > cost * TimeUnit.MILLISECONDS.toNanos(1);
}
return false;
} }
private void calculateBruteForceAll() { private void calculateBruteForceAll() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论