Skip to content

Commit

Permalink
Simplify some things
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisGoosen authored Oct 23, 2024
1 parent ee9c601 commit 9a70197
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions QMLComponents/controls/jasplistcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,7 @@ std::vector<std::string> JASPListControl::usedVariables() const
Json::Value JASPListControl::valueTypes() const
{
Json::Value types(Json::arrayValue);
std::map<std::string, std::string> variableTypeMap;
static columnType unknownType = columnType::unknown;
strstrmap variableTypeMap;

// An interaction term has components that can be variables: if the model contains also such variables, the interaction term should get the same types.
// So first check which terms have only 1 component: these terms might be variable names, so keep in a map their types. Use then this map to set the type for interaction terms.
Expand All @@ -316,12 +315,7 @@ Json::Value JASPListControl::valueTypes() const
{
Json::Value compTypes(Json::arrayValue);
for (const std::string& component : term.scomponents())
{
if (variableTypeMap.count(component) > 0)
compTypes.append(variableTypeMap[component]);
else
compTypes.append(columnTypeToString(unknownType));
}
compTypes.append(variableTypeMap.count(component) > 0 ? variableTypeMap[component] : columnTypeToString(columnType::unknown));
types.append(compTypes);
}
}
Expand Down

0 comments on commit 9a70197

Please sign in to comment.