Skip to content
Snippets Groups Projects
Unverified Commit 3aed0292 authored by Shylock Hg's avatar Shylock Hg Committed by GitHub
Browse files

Reuse the vid type check function. (#313)


Co-authored-by: default avatardutor <440396+dutor@users.noreply.github.com>
parent 59aaa895
No related branches found
No related tags found
No related merge requests found
......@@ -341,16 +341,14 @@ bool SchemaUtil::isValidVid(const Value &value, const meta::cpp2::ColumnTypeDef
bool SchemaUtil::isValidVid(const Value &value, meta::cpp2::PropertyType type) {
auto vidType = propTypeToValueType(type);
if ((vidType != Value::Type::STRING
&& vidType != Value::Type::INT) // compatible with 1.0
|| value.type() != vidType) {
if (!isValidVid(value) || value.type() != vidType) {
return false;
}
return true;
}
bool SchemaUtil::isValidVid(const Value &value) {
if (!value.isStr() && !value.isInt()) {
if (!value.isStr() && !value.isInt()) { // compatible with 1.0
return false;
}
return true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment