Skip to content

Commit 39d976d

Browse files
authored
Merge pull request #990 from czgdp1807/dict03
Implement separate chaining implicitly via linear probing
2 parents c982a7a + f525230 commit 39d976d

File tree

4 files changed

+255
-48
lines changed

4 files changed

+255
-48
lines changed

integration_tests/test_dict_01.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ def test_dict():
1212
assert abs(rollnumber2cpi[i] - i/100.0 - 5.0) <= 1e-12
1313

1414
assert abs(rollnumber2cpi[0] - 1.1) <= 1e-12
15+
assert len(rollnumber2cpi) == 1001
1516

1617
test_dict()

src/libasr/codegen/asr_to_llvm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
238238
llvm_utils(std::make_unique<LLVMUtils>(context, builder.get())),
239239
list_api(std::make_unique<LLVMList>(context, llvm_utils.get(), builder.get())),
240240
tuple_api(std::make_unique<LLVMTuple>(context, llvm_utils.get(), builder.get())),
241-
dict_api(std::make_unique<LLVMDict>(context, llvm_utils.get(), builder.get())),
241+
dict_api(std::make_unique<LLVMDictOptimizedLinearProbing>(context, llvm_utils.get(), builder.get())),
242242
arr_descr(LLVMArrUtils::Descriptor::get_descriptor(context,
243243
builder.get(),
244244
llvm_utils.get(),

0 commit comments

Comments
 (0)