Skip to content

Commit

Permalink
Merge pull request #68 from myyrakle/fix/#67
Browse files Browse the repository at this point in the history
[#67] fix HashSet bugs
  • Loading branch information
myyrakle authored Oct 22, 2023
2 parents d479947 + 152c2c9 commit 3a257ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gost

![](https://img.shields.io/badge/language-Go-00ADD8) ![](https://img.shields.io/badge/version-v0.7.0-brightgreen) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
![](https://img.shields.io/badge/language-Go-00ADD8) ![](https://img.shields.io/badge/version-v0.7.1-brightgreen) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)

![](./etc/gorris.jpg)

Expand All @@ -11,7 +11,7 @@ Experience the true taste of Rust in Go
## Install

```
go get github.com/myyrakle/[email protected].0
go get github.com/myyrakle/[email protected].1
```

## Example
Expand Down
12 changes: 10 additions & 2 deletions btree_map.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gost

import "strings"
import (
"strings"
)

const _B = 6
const _BTREE_CAPACITY = _B*2 - 1
Expand Down Expand Up @@ -283,7 +285,13 @@ func (self BTreeNode[K, V]) _Search(key K) (Option[*BTreeNode[K, V]], uint) {
}

// Go to the appropriate child
return self.childs.GetUnchecked(i)._Search(key)
child := self.childs.GetUnchecked(i)

if child != nil {
return child._Search(key)
} else {
return None[*BTreeNode[K, V]](), 0
}
}

// The main function that inserts a new key in this B-Tree
Expand Down
2 changes: 1 addition & 1 deletion btree_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gost
import "strings"

type BTreeSet[K Ord[K]] struct {
_treemap *BTreeMap[K, struct{}]
_treemap BTreeMap[K, struct{}]
}

// Creates an empty BTreeSet.
Expand Down

0 comments on commit 3a257ac

Please sign in to comment.