]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Use braced initializer lists for map insertions
[builder.git] / source / builder.cpp
index ceb7db3581f7db02915b8433fdfda56532657811..a49624d13201d6eb8d9112f6653c1546909cf85f 100644 (file)
@@ -324,7 +324,7 @@ void Builder::Loader::build_type(const string &n)
 {
        BuildType btype(n);
        load_sub(btype);
-       auto i = obj.build_types.insert(BuildTypeMap::value_type(n, btype)).first;
+       auto i = obj.build_types.insert({ n, btype }).first;
        if(!obj.build_type)
                obj.build_type = &i->second;
 }
@@ -333,10 +333,7 @@ void Builder::Loader::package(const string &n)
 {
        SourcePackage *pkg = new SourcePackage(obj, n, get_source());
 
-       if(options)
-               load_sub(*pkg, *options);
-       else
-               load_sub(*pkg);
+       load_sub(*pkg, options);
 
        if(obj.build_type)
                pkg->set_build_type(*obj.build_type);