Skip to content

Commit

Permalink
rename Searcher -> KeySearcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil Tolmachev authored and mkrd committed Nov 27, 2022
1 parent 66a6a41 commit 325d3c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dictdatabase/io_unsafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from . import io_bytes
from . import utils
from .index_manager import IndexManager
from .searching import Searcher
from .searching import KeySearcher


@dataclass(frozen=True) # slots=True not supported by python 3.8 and 3.9
Expand Down Expand Up @@ -88,7 +88,7 @@ def partial_read_only(db_name: str, key: str) -> dict | None:

# Not found in index file, search for key in the entire file
all_file_bytes = io_bytes.read(db_name)
start, end, found = Searcher().search(all_file_bytes, key)
start, end, found = KeySearcher().search(all_file_bytes, key)
if not found:
return None
value_bytes = all_file_bytes[start:end]
Expand Down
2 changes: 1 addition & 1 deletion dictdatabase/searching.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dictdatabase import utils


class Searcher:
class KeySearcher:
@staticmethod
def find_start_end_in_bytes(file: bytes, key: str) -> Tuple[int, int, bool]:
"""
Expand Down

0 comments on commit 325d3c7

Please sign in to comment.