Inlined trivial comparator.

This commit is contained in:
Guillaume Melquiond 2010-08-14 21:02:59 +00:00
parent 081fb8fcad
commit 87831d566d
2 changed files with 6 additions and 11 deletions

View file

@ -881,15 +881,10 @@ void file_tree_checksum::write(config& cfg) const
cfg["modified"] = lexical_cast<std::string>(modified);
}
bool operator==(const file_tree_checksum& lhs, const file_tree_checksum& rhs)
bool file_tree_checksum::operator==(const file_tree_checksum &rhs) const
{
return lhs.nfiles == rhs.nfiles && lhs.sum_size == rhs.sum_size &&
lhs.modified == rhs.modified;
}
bool operator!=(const file_tree_checksum& lhs, const file_tree_checksum& rhs)
{
return !operator==(lhs,rhs);
return nfiles == rhs.nfiles && sum_size == rhs.sum_size &&
modified == rhs.modified;
}
static void get_file_tree_checksum_internal(const std::string& path, file_tree_checksum& res)

View file

@ -141,11 +141,11 @@ struct file_tree_checksum
// @todo make variables private!
size_t nfiles, sum_size;
time_t modified;
bool operator==(const file_tree_checksum &rhs) const;
bool operator!=(const file_tree_checksum &rhs) const
{ return !operator==(rhs); }
};
bool operator==(const file_tree_checksum& lhs, const file_tree_checksum& rhs);
bool operator!=(const file_tree_checksum& lhs, const file_tree_checksum& rhs);
/** Get the time at which the data/ tree was last modified at. */
const file_tree_checksum& data_tree_checksum(bool reset = false);