66from dictdatabase import utils
77
88
9- def find_start_end_in_bytes (file : bytes , key : str ) -> Tuple [int , int , bool ]:
9+ def find_key_position_in_bytes (file : bytes , key : str ) -> Tuple [int , int , bool ]:
1010 """
1111 It finds the start and end indices of the value of a key in a JSON file
1212
@@ -25,7 +25,7 @@ def find_start_end_in_bytes(file: bytes, key: str) -> Tuple[int, int, bool]:
2525 return start , end , True
2626
2727
28- def search_key (file : bytes , key : str , glom_searching = True ) -> Tuple [int , int , bool ]:
28+ def search_key_position_in_db (file : bytes , key : str , glom_searching = True ) -> Tuple [int , int , bool ]:
2929 original_value_start = 0
3030 original_value_end = len (file )
3131 original_key_start = 0
@@ -36,14 +36,14 @@ def search_key(file: bytes, key: str, glom_searching=True) -> Tuple[int, int, bo
3636 return - 1 , - 1 , False
3737 original_key_end = original_value_start + key_end
3838 original_key_start = original_value_start + key_start
39- value_start , value_end , found = find_start_end_in_bytes (file , k )
39+ value_start , value_end , found = find_key_position_in_bytes (file , k )
4040 original_value_end = original_value_start + original_value_end
4141 original_value_start += value_start
4242 file = file [original_value_start :original_value_end ]
4343 return original_key_start , original_key_end , True
4444
4545
46- def search_value_by_key (
46+ def search_value_position_in_db (
4747 all_file_bytes : bytes , key : str , glom_searching = True
4848) -> Tuple [int , int , bool ]:
4949 """
@@ -61,7 +61,7 @@ def search_value_by_key(
6161 original_start = 0
6262 original_end = len (all_file_bytes )
6363 for k in key .split ("." ) if glom_searching else [key ]:
64- start , end , found = find_start_end_in_bytes (
64+ start , end , found = find_key_position_in_bytes (
6565 all_file_bytes [original_start :original_end ], k
6666 )
6767 if not found :
0 commit comments