Skip to content

Commit

Permalink
Resolving custom var mapping issue for empty mapping scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm committed Feb 3, 2024
1 parent 59a5490 commit 9eeb415
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion omnn/math/Valuable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
#endif
}

Valuable::Valuable(std::string_view s, const Valuable::va_names_t& vaNames, bool itIsOptimized) {
Valuable::Valuable(std::string_view s, const Valuable::va_names_t& vaNames, bool itIsOptimized)
{
#if !defined(NDEBUG) && !defined(NOOMDEBUG)
if (s.empty()) {
IMPLEMENT
Expand Down Expand Up @@ -1084,6 +1085,9 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
if (itIsOptimized)
v.MarkAsOptimized();
Become(std::move(v));
} else if (vaNames.empty()) {
Valuable varless(s, nullptr, itIsOptimized);
Become(std::move(varless));
} else {
Become(Valuable(s, vaNames.begin()->second.getVaHost(), itIsOptimized));
}
Expand Down

0 comments on commit 9eeb415

Please sign in to comment.