mirror of https://github.com/django/django.git
Refs #32940 -- Removed Node.add()'s unused squash parameter.
Unused since its introduction in d3f00bd570
.
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
This commit is contained in:
parent
fee8734596
commit
fb35e0a2fe
|
@ -76,7 +76,7 @@ class Node:
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return hash((self.__class__, self.connector, self.negated, *make_hashable(self.children)))
|
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
|
Combine this tree and the data represented by data using the
|
||||||
connector conn_type. The combine is done by squashing the node other
|
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
|
Return a node which can be used in place of data regardless if the
|
||||||
node other got squashed or not.
|
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:
|
if self.connector == conn_type and data in self.children:
|
||||||
return data
|
return data
|
||||||
if not squash:
|
|
||||||
self.children.append(data)
|
|
||||||
return data
|
|
||||||
if self.connector == conn_type:
|
if self.connector == conn_type:
|
||||||
# We can reuse self.children to append or squash the node other.
|
# We can reuse self.children to append or squash the node other.
|
||||||
if (isinstance(data, Node) and not data.negated and
|
if (isinstance(data, Node) and not data.negated and
|
||||||
|
|
Loading…
Reference in New Issue