Skip to content

Commit 9eeb415

Browse files
committed
Resolving custom var mapping issue for empty mapping scenario
1 parent 59a5490 commit 9eeb415

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

omnn/math/Valuable.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
950950
#endif
951951
}
952952

953-
Valuable::Valuable(std::string_view s, const Valuable::va_names_t& vaNames, bool itIsOptimized) {
953+
Valuable::Valuable(std::string_view s, const Valuable::va_names_t& vaNames, bool itIsOptimized)
954+
{
954955
#if !defined(NDEBUG) && !defined(NOOMDEBUG)
955956
if (s.empty()) {
956957
IMPLEMENT
@@ -1084,6 +1085,9 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
10841085
if (itIsOptimized)
10851086
v.MarkAsOptimized();
10861087
Become(std::move(v));
1088+
} else if (vaNames.empty()) {
1089+
Valuable varless(s, nullptr, itIsOptimized);
1090+
Become(std::move(varless));
10871091
} else {
10881092
Become(Valuable(s, vaNames.begin()->second.getVaHost(), itIsOptimized));
10891093
}

0 commit comments

Comments
 (0)