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

cleanup - avoid checking for null before instanceof

上级 ba4c7216
......@@ -456,7 +456,7 @@ public class ConnectionInfo implements Cloneable {
*/
String getProperty(String key) {
Object value = prop.get(key);
if (value == null || !(value instanceof String)) {
if (!(value instanceof String)) {
return null;
}
return value.toString();
......
......@@ -85,7 +85,7 @@ public class Parameter extends Expression implements ParameterInterface {
@Override
public Expression optimize(Session session) {
if (session.getDatabase().getMode().treatEmptyStringsAsNull) {
if (value != null && value instanceof ValueString) {
if (value instanceof ValueString) {
value = ValueString.get(value.getString(), true);
}
}
......
......@@ -814,7 +814,7 @@ public class MetaTable extends Table {
// reduce the number of tables to scan - makes some metadata queries
// 10x faster
final ArrayList<Table> tablesToList;
if (indexFrom != null && indexTo != null && indexFrom.equals(indexTo)) {
if (indexFrom != null && indexFrom.equals(indexTo)) {
String tableName = identifier(indexFrom.getString());
tablesToList = getTablesByName(session, tableName);
} else {
......@@ -895,7 +895,7 @@ public class MetaTable extends Table {
// reduce the number of tables to scan - makes some metadata queries
// 10x faster
final ArrayList<Table> tablesToList;
if (indexFrom != null && indexTo != null && indexFrom.equals(indexTo)) {
if (indexFrom != null && indexFrom.equals(indexTo)) {
String tableName = identifier(indexFrom.getString());
tablesToList = getTablesByName(session, tableName);
} else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论