diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-20 07:53:40 +0100 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-03-01 16:40:58 +0200 |
| commit | efd4193afb3ed5635909f2b88224c541aad978e7 (patch) | |
| tree | 25f54f0886acd0b63c9a3ac6fbde064a200c3838 | |
| parent | 0ce21ac78a09e70735ba63e873ac8587a41af140 (diff) | |
| download | meson-efd4193afb3ed5635909f2b88224c541aad978e7.tar.gz | |
arglist: post is only appended to, make it a list
self.post is only ever appended to on the right hand. However,
it is then reversed twice in flush_pre_post(), by using "for a in
reversed.post()" and appendleft() within the loop. It would be tempting
to use appendleft() in __iadd__ to avoid the call to reversed(), but that
is not a good idea because the loop of flush_pre_post() is part of a slow
path. It's rather more important to use a fast extend-with-list-argument
in the fast path where needs_override_check if False.
For clarity, and to remove the temptation, make "post" a list instead
of a deque.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | mesonbuild/arglist.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/arglist.py b/mesonbuild/arglist.py index 3d9bb722a..4f4d18c55 100644 --- a/mesonbuild/arglist.py +++ b/mesonbuild/arglist.py @@ -106,7 +106,7 @@ class CompilerArgs(T.MutableSequence[str]): self._container: T.List[str] = list(iterable) if iterable is not None else [] self.pre: T.Deque[str] = collections.deque() - self.post: T.Deque[str] = collections.deque() + self.post: T.List[str] = [] self.needs_override_check: bool = False # Flush the saved pre and post list into the _container list |
