Skip to content

Commit d8966a9

Browse files
committed
Cleanup
Signed-off-by: falkTX <falktx@falktx.com>
1 parent b959c54 commit d8966a9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

plugins/plugins.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,18 +1069,17 @@ struct StaticPluginLoader {
10691069
return;
10701070
}
10711071

1072-
std::string version = "0.0.0";
1073-
json_t* versionJ = json_object_get(rootJ, "version");
1074-
if (versionJ)
1072+
std::string version;
1073+
if (json_t* const versionJ = json_object_get(rootJ, "version"))
10751074
version = json_string_value(versionJ);
10761075

10771076
if (!string::startsWith(version, APP_VERSION_MAJOR + "."))
1077+
{
10781078
// force ABI, we use static plugins so this doesnt matter as long as it builds
1079-
version = version.replace(0, 1, APP_VERSION_MAJOR).c_str();
1080-
1081-
json_t* json_version = json_string(version.c_str());
1082-
json_object_set(rootJ, "version", json_version);
1083-
json_decref(json_version);
1079+
json_t* json_version = json_string((APP_VERSION_MAJOR + ".0").c_str());
1080+
json_object_set(rootJ, "version", json_version);
1081+
json_decref(json_version);
1082+
}
10841083

10851084
// Load manifest
10861085
p->fromJson(rootJ);

0 commit comments

Comments
 (0)