From 75068e7d753cf6cbe45a4bf294000dca9bd41d8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Sep 2006 21:06:23 +0000 Subject: * Use a proper namespace. * Optimise header file usage a bit. * Compile the parser as C++. --- src/libstore/db.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/libstore/db.cc') diff --git a/src/libstore/db.cc b/src/libstore/db.cc index 7f428dc488e6..ca5d0582a099 100644 --- a/src/libstore/db.cc +++ b/src/libstore/db.cc @@ -1,3 +1,7 @@ +#include "db.hh" +#include "util.hh" +#include "pathlocks.hh" + #include #include #include @@ -7,9 +11,8 @@ #include -#include "db.hh" -#include "util.hh" -#include "pathlocks.hh" + +namespace nix { /* Wrapper class to ensure proper destruction. */ @@ -112,7 +115,7 @@ Db * Database::getDb(TableId table) if (table == 0) throw Error("database table is not open " "(maybe you don't have sufficient permission?)"); - map::iterator i = tables.find(table); + std::map::iterator i = tables.find(table); if (i == tables.end()) throw Error("unknown table id"); return i->second; @@ -263,10 +266,10 @@ void Database::close() try { - for (map::iterator i = tables.begin(); + for (std::map::iterator i = tables.begin(); i != tables.end(); ) { - map::iterator j = i; + std::map::iterator j = i; ++j; closeTable(i->first); i = j; @@ -433,3 +436,6 @@ void Database::enumTable(const Transaction & txn, TableId table, } catch (DbException e) { rethrow(e); } } + + +} -- cgit 1.4.1