Skip to content

Commit

Permalink
chore: follow-up to reduce memory footprint (#1625)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Nov 2, 2022
1 parent f123f8f commit 0ada04f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions playwright/_impl/_js_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import math
from dataclasses import dataclass
from datetime import datetime
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from urllib.parse import ParseResult, urlparse, urlunparse
Expand All @@ -28,10 +27,13 @@
Serializable = Any


@dataclass
class VisitorInfo:
visited: Map[Any, int] = Map()
last_id: int = 0
visited: Map[Any, int]
last_id: int

def __init__(self) -> None:
self.visited = Map()
self.last_id = 0

def visit(self, obj: Any) -> int:
assert obj not in self.visited
Expand Down

0 comments on commit 0ada04f

Please sign in to comment.