提交 087f7a18 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not call HashSet.contains() before add(), use return value of add() in ConnectionInfo

上级 0d7a03ba
...@@ -101,10 +101,9 @@ public class ConnectionInfo implements Cloneable { ...@@ -101,10 +101,9 @@ public class ConnectionInfo implements Cloneable {
"USER", "AUTO_SERVER", "AUTO_SERVER_PORT", "NO_UPGRADE", "USER", "AUTO_SERVER", "AUTO_SERVER_PORT", "NO_UPGRADE",
"AUTO_RECONNECT", "OPEN_NEW", "PAGE_SIZE", "PASSWORD_HASH", "JMX" }; "AUTO_RECONNECT", "OPEN_NEW", "PAGE_SIZE", "PASSWORD_HASH", "JMX" };
for (String key : connectionTime) { for (String key : connectionTime) {
if (SysProperties.CHECK && set.contains(key)) { if (!set.add(key) && SysProperties.CHECK) {
DbException.throwInternalError(key); DbException.throwInternalError(key);
} }
set.add(key);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论