diff options
author | Keryn Knight <keryn@kerynknight.com> | 2021-07-18 12:04:27 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-07-20 07:19:28 +0200 |
commit | fb35e0a2feb36e60b93a12dd43eb9eed2015adda (patch) | |
tree | 0e27702569e2e03c2b237d127c267fa9666c8b99 /django/utils/tree.py | |
parent | fee87345967b3d917b618533585076cbfa43451b (diff) | |
download | django-fb35e0a2feb36e60b93a12dd43eb9eed2015adda.tar.gz |
Refs #32940 -- Removed Node.add()'s unused squash parameter.
Unused since its introduction in d3f00bd5706b35961390d3814dd7e322ead3a9a3.
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
Diffstat (limited to 'django/utils/tree.py')
-rw-r--r-- | django/utils/tree.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/django/utils/tree.py b/django/utils/tree.py index def1c78577..d13883a00e 100644 --- a/django/utils/tree.py +++ b/django/utils/tree.py @@ -76,7 +76,7 @@ class Node: def __hash__(self): return hash((self.__class__, self.connector, self.negated, *make_hashable(self.children))) - def add(self, data, conn_type, squash=True): + def add(self, data, conn_type): """ Combine this tree and the data represented by data using the connector conn_type. The combine is done by squashing the node other @@ -87,15 +87,9 @@ class Node: Return a node which can be used in place of data regardless if the node other got squashed or not. - - If `squash` is False the data is prepared and added as a child to - this tree without further logic. """ if self.connector == conn_type and data in self.children: return data - if not squash: - self.children.append(data) - return data if self.connector == conn_type: # We can reuse self.children to append or squash the node other. if (isinstance(data, Node) and not data.negated and |