From 54a34119f349d531557af9e90d21d04d689ee817 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 26 May 2014 17:53:17 +0200 Subject: [PATCH] Use std::unordered_set --- configure.ac | 6 ------ src/libexpr/symbol-table.hh | 11 ++--------- src/libstore/local-store.hh | 12 ++---------- src/libstore/local.mk | 3 +-- 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/configure.ac b/configure.ac index 043aed5b3..55e6191cf 100644 --- a/configure.ac +++ b/configure.ac @@ -134,12 +134,6 @@ AC_CHECK_HEADERS([sys/personality.h]) AC_CHECK_HEADERS([linux/fs.h]) -# Check for tr1/unordered_set. -AC_LANG_PUSH(C++) -AC_CHECK_HEADERS([tr1/unordered_set]) -AC_LANG_POP(C++) - - AC_DEFUN([NEED_PROG], [ AC_PATH_PROG($1, $2) diff --git a/src/libexpr/symbol-table.hh b/src/libexpr/symbol-table.hh index 08e31d496..140662b51 100644 --- a/src/libexpr/symbol-table.hh +++ b/src/libexpr/symbol-table.hh @@ -3,10 +3,7 @@ #include "config.h" #include - -#if HAVE_TR1_UNORDERED_SET -#include -#endif +#include #include "types.hh" @@ -70,11 +67,7 @@ inline std::ostream & operator << (std::ostream & str, const Symbol & sym) class SymbolTable { private: -#if HAVE_TR1_UNORDERED_SET - typedef std::tr1::unordered_set Symbols; -#else - typedef std::set Symbols; -#endif + typedef std::unordered_set Symbols; Symbols symbols; public: diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 54331e448..e58e6563f 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -1,16 +1,12 @@ #pragma once #include +#include #include "store-api.hh" #include "util.hh" #include "pathlocks.hh" -#if HAVE_TR1_UNORDERED_SET -#include -#endif - - class sqlite3; class sqlite3_stmt; @@ -306,11 +302,7 @@ private: void checkDerivationOutputs(const Path & drvPath, const Derivation & drv); -#if HAVE_TR1_UNORDERED_SET - typedef std::tr1::unordered_set InodeHash; -#else - typedef std::set InodeHash; -#endif + typedef std::unordered_set InodeHash; InodeHash loadInodeHash(); Strings readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash); diff --git a/src/libstore/local.mk b/src/libstore/local.mk index 40cb25dc5..64dbfa3c5 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -21,8 +21,7 @@ libstore_CXXFLAGS = \ -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ - -DNIX_BIN_DIR=\"$(bindir)\" \ - -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" + -DNIX_BIN_DIR=\"$(bindir)\" $(d)/local-store.cc: $(d)/schema.sql.hh