提交 c853fb82 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use result of remove() instead of containskey() in Schema.remove()

上级 946cca91
...@@ -672,10 +672,9 @@ public class Schema extends DbObjectBase { ...@@ -672,10 +672,9 @@ public class Schema extends DbObjectBase {
public void remove(SchemaObject obj) { public void remove(SchemaObject obj) {
String objName = obj.getName(); String objName = obj.getName();
Map<String, SchemaObject> map = getMap(obj.getType()); Map<String, SchemaObject> map = getMap(obj.getType());
if (SysProperties.CHECK && !map.containsKey(objName)) { if (map.remove(objName) == null) {
DbException.throwInternalError("not found: " + objName); DbException.throwInternalError("not found: " + objName);
} }
map.remove(objName);
freeUniqueName(objName); freeUniqueName(objName);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论