From 9d0562d22cef95b0db1af30e199a371670ca8050 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Tue, 23 Apr 2013 18:28:33 +0200 Subject: remove hashing stuff the cases in which that gave a speedup are rare to nonexistent --- inode.h | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'inode.h') diff --git a/inode.h b/inode.h index 26db923..5c74a79 100644 --- a/inode.h +++ b/inode.h @@ -25,39 +25,16 @@ #include #include -#include - -class inode { -public: +struct inode { std::string const filename; struct stat const stat; -protected: - uLong mutable adler; - -public: inode (std::string const &, struct stat const); - uLong get_adler () const; - friend bool compare (inode const &, inode const &); friend std::ostream& operator<< (std::ostream&, inode const &); }; -inline inode::inode (std::string const & __filename, struct stat const __stat) : filename(__filename), stat(__stat), adler(-1) { -} - -inline uLong inode::get_adler () const { - if (adler == uLong(-1)) { - char buffer[1 << 14]; - std::ifstream f(filename.c_str()); - - adler = adler32(0L, Z_NULL, 0); - while (not f.eof()) { - f.read(buffer, sizeof(buffer)); - adler = adler32(adler, (Bytef *) buffer, f.gcount()); - } - } - return adler; +inline inode::inode (std::string const & __filename, struct stat const __stat) : filename(__filename), stat(__stat) { } inline bool compare (inode const & l, inode const & r) { -- cgit v1.2.3