Skip to content

Commit 2e5daae

Browse files
committed
Revert "Add an extra assert which makes sure optimization is correct"
This reverts commit 306bfb5.
1 parent 306bfb5 commit 2e5daae

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

extruct/w3cmicrodata.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,14 @@ def __init__(self, nested=True, strict=False, add_text_content=False, add_html_n
6565

6666
def get_docid(self, node, itemids):
6767
try:
68-
itemid = itemids[node] # same as self.get_docid(node, {})
68+
return itemids[node] # same as self.get_docid(node, {})
6969
except KeyError:
7070
# Even after itemids are built,
7171
# this might fail if extract_items is called on a part of the document,
7272
# and then properties reference some node which is not in itemids,
7373
# although this does not look likely in practice,
7474
# so not a performance concern.
7575
return int(self._xp_item_docid(node))
76-
else:
77-
# will be removed, this is to make sure optimization is correct
78-
assert itemid == self.get_docid(node, {})
79-
return itemid
8076

8177
def extract(self, htmlstring, base_url=None, encoding="UTF-8"):
8278
tree = parse_html(htmlstring, encoding=encoding)

0 commit comments

Comments
 (0)