more changes
This commit is contained in:
@@ -7,11 +7,14 @@ namespace kmake {
|
||||
Distro::~Distro() {}
|
||||
|
||||
optional<string> Distro::getVar(const string& name) {
|
||||
// find distro var
|
||||
auto it = vars.find(name);
|
||||
if (it != vars.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return {};
|
||||
|
||||
// check if project has it
|
||||
return project->getVar(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -285,14 +285,7 @@ namespace kmake {
|
||||
}
|
||||
|
||||
Distro& Project::getDistro(const string& distro_name) {
|
||||
auto it = distros.find(distro_name);
|
||||
if (it != distros.end()) {
|
||||
return it->second;
|
||||
}
|
||||
// Return reference to first distro if exists, otherwise create a default
|
||||
// This should not happen if hasDistro is checked first
|
||||
static Distro empty_distro;
|
||||
return empty_distro;
|
||||
return distros.find(distro_name)->second;
|
||||
}
|
||||
|
||||
optional<string> Project::getVar(const string& var_name) {
|
||||
|
||||
Reference in New Issue
Block a user