mirror of
https://codeberg.org/Freedium-cfd/web.git
synced 2026-03-11 09:04:37 +00:00
refactor(utf_handler): add __slots__ for memory optimization and remove unused position_mappings property
This commit is contained in:
parent
038cb9aefc
commit
f0658ca167
1 changed files with 2 additions and 4 deletions
|
|
@ -124,6 +124,8 @@ class PositionTracker:
|
|||
|
||||
|
||||
class UTFHandler(ABC):
|
||||
__slots__ = ("_string", "_encoding", "_position_tracker")
|
||||
|
||||
def __init__(self, string: str, encoding: UTFEncoding):
|
||||
logger.debug(
|
||||
f"Initializing UTFHandler with string: '{string}' and encoding: {encoding}"
|
||||
|
|
@ -212,10 +214,6 @@ class UTFHandler(ABC):
|
|||
logger.debug(f"Final original position: {original_pos}")
|
||||
return original_pos
|
||||
|
||||
@property
|
||||
def position_mappings(self) -> List[CharacterMapping]:
|
||||
return self._position_tracker.get()
|
||||
|
||||
def insert(self, encoded_position: int, string_to_insert: str) -> None:
|
||||
logger.info(
|
||||
f"Inserting '{string_to_insert}' at encoded position {encoded_position}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue