aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 13:25:52 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 13:25:52 +0100
commitc57b86336fbf7449ea4f78efafb337af03c6325e (patch)
treefb3c7413fb8e62ff55dd199b95aeb5837eeeb843
parent5a6f4f506d67f4c0a347e3e806960edfb4a1417e (diff)
downloadpaludis-c57b86336fbf7449ea4f78efafb337af03c6325e.tar.gz
paludis-c57b86336fbf7449ea4f78efafb337af03c6325e.tar.xz
Cache of hash doesn't make much difference
-rw-r--r--paludis/version_spec.cc14
1 files changed, 0 insertions, 14 deletions
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index ed18f8e..1ff82c4 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -59,14 +59,9 @@ namespace paludis
std::string text;
Parts parts;
- mutable Mutex hash_mutex;
- mutable bool has_hash;
- mutable std::size_t hash;
-
const VersionSpecOptions options;
Imp(const VersionSpecOptions & o) :
- has_hash(false),
options(o)
{
}
@@ -343,8 +338,6 @@ VersionSpec::operator= (const VersionSpec & other)
{
_imp->text = other._imp->text;
_imp->parts = other._imp->parts;
- _imp->has_hash = other._imp->has_hash;
- _imp->hash = other._imp->hash;
}
return *this;
}
@@ -523,11 +516,6 @@ VersionSpec::stupid_equal_star_compare(const VersionSpec & other) const
std::size_t
VersionSpec::hash() const
{
- Lock l(_imp->hash_mutex);
-
- if (_imp->has_hash)
- return _imp->hash;
-
size_t result(0);
const std::size_t h_shift = std::numeric_limits<std::size_t>::digits - 5;
@@ -571,8 +559,6 @@ VersionSpec::hash() const
}
} while (false);
- _imp->has_hash = true;
- _imp->hash = result;
return result;
}