Skip to content

Commit

Permalink
indent code and add testcases for runes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedelhefni authored and dghubble committed Sep 20, 2024
1 parent 0b20e67 commit 186e97c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rune_trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func (trie *RuneTrie) Delete(key string) bool {
if node.isLeaf() {
// iterate backwards over path
for i := len(key) - 1; i >= 0; i-- {
if path[i].node == nil {
continue
}
if path[i].node == nil {
continue
}
parent := path[i].node
r := path[i].r
delete(parent.children, r)
Expand Down
2 changes: 2 additions & 0 deletions trie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func testTrie(t *testing.T, trie Trier) {
{"/caterpillar", 4},
{"/cat/gideon", 5},
{"/cat/giddy", 6},
{"مسار", 7},
{"這是第三個值", 8},
}

// get missing keys
Expand Down

0 comments on commit 186e97c

Please sign in to comment.