aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonlib.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-08-22 18:40:03 +0300
committerGitHub <noreply@github.com>2020-08-22 18:40:03 +0300
commite9a71ebf60a91443ae024dea94a8b68d46987589 (patch)
tree9dee7c38fb246d8e7f351437d06a4fb7214fcde8 /mesonbuild/mesonlib.py
parentc42298e1460f838710bfe1d33b5635bec25fa8ba (diff)
parent847bb4347039e8f52c661a6d9cddd411f42b41ed (diff)
downloadmeson-e9a71ebf60a91443ae024dea94a8b68d46987589.zip
meson-e9a71ebf60a91443ae024dea94a8b68d46987589.tar.gz
meson-e9a71ebf60a91443ae024dea94a8b68d46987589.tar.bz2
Merge pull request #7607 from bonzini/speedup
Various speedups from profiling QEMU's meson.build
Diffstat (limited to 'mesonbuild/mesonlib.py')
-rw-r--r--mesonbuild/mesonlib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py
index 4b8cce8..760b235 100644
--- a/mesonbuild/mesonlib.py
+++ b/mesonbuild/mesonlib.py
@@ -242,6 +242,7 @@ class File:
self.is_built = is_built
self.subdir = subdir
self.fname = fname
+ self.hash = hash((is_built, subdir, fname))
def __str__(self) -> str:
return self.relative_name()
@@ -291,10 +292,12 @@ class File:
def __eq__(self, other) -> bool:
if not isinstance(other, File):
return NotImplemented
+ if self.hash != other.hash:
+ return False
return (self.fname, self.subdir, self.is_built) == (other.fname, other.subdir, other.is_built)
def __hash__(self) -> int:
- return hash((self.fname, self.subdir, self.is_built))
+ return self.hash
@lru_cache(maxsize=None)
def relative_name(self) -> str: