Skip to content

fix: use the correct key to search the value#33

Open
pinkbit256 wants to merge 1 commit intoBerkeley-CS61B:mainfrom
pinkbit256:jennie-patch-fix
Open

fix: use the correct key to search the value#33
pinkbit256 wants to merge 1 commit intoBerkeley-CS61B:mainfrom
pinkbit256:jennie-patch-fix

Conversation

@pinkbit256
Copy link

@pinkbit256 pinkbit256 commented Aug 6, 2024

Because it uses the key to search for the entry, it always searches for the first entry’s key instead of the specified k.
If you want me to add an unit test, I'm glad to add it.

public static void main(String[] args) {
        ULLMap<String, Integer> map = new ULLMap<>();
        map.put("Jennie", 24);
        map.put("Rustin", 28);
        System.out.println(map.get("Jennie"));
}

Before I correct this problem, it always prints null. After correction, it prints out 24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant