Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BitArray and replace trie.Key #2322

Merged
merged 63 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a31db6f
this works
weiihann Dec 13, 2024
566a578
one failed but im getting closer
weiihann Dec 13, 2024
e57e0a8
this works
weiihann Dec 13, 2024
f851e17
add bytes benchmark
weiihann Dec 13, 2024
48248ae
looks gud
weiihann Dec 13, 2024
951b65d
add Rsh test
weiihann Dec 14, 2024
271de3b
add Truncate
weiihann Dec 14, 2024
85e883c
add CommonMSBs
weiihann Dec 15, 2024
48cb0f0
minor comments
weiihann Dec 15, 2024
b8d3bc0
add UnmarshalBinary
weiihann Dec 15, 2024
2577058
more bitArray public
weiihann Dec 15, 2024
b968ff3
add IsBitSet
weiihann Dec 15, 2024
64b562e
fix lint and comments
weiihann Dec 15, 2024
3dd95fe
Felt return value
weiihann Dec 16, 2024
7e9ab77
add felt tests
weiihann Dec 17, 2024
a9f5218
use const for 0xFF...FF
weiihann Dec 17, 2024
ffc2498
add MSBs
weiihann Dec 17, 2024
19c53ec
add MSBs() and rename Truncate to LSBs
weiihann Dec 17, 2024
dd75651
all tests passed
weiihann Dec 17, 2024
9bfe1a3
improve comments
weiihann Dec 18, 2024
60781ec
fix lint
weiihann Dec 18, 2024
521531d
minor chore
weiihann Dec 18, 2024
f12f359
improvements
weiihann Dec 19, 2024
2150c4a
ensure unused bits are zero when setting bitarray
weiihann Dec 20, 2024
2709ded
update comment
weiihann Dec 20, 2024
0bbd42c
Add LSBsAtPos()
weiihann Dec 26, 2024
ea1634c
Add BitSet()
weiihann Dec 26, 2024
9368784
Add BitSetAtMSB()
weiihann Dec 27, 2024
3c8cd5f
add IsEmpty()
weiihann Dec 27, 2024
bd5100e
Add Lsh, Or, Append
weiihann Dec 27, 2024
b8378a7
fix rebase
weiihann Dec 27, 2024
bb59370
Add BitSetFromMSB()
weiihann Dec 30, 2024
5bd1cc3
Reverse methods between LSBs and MSBs
weiihann Dec 30, 2024
71fd5b7
Revert "Reverse methods between LSBs and MSBs"
weiihann Dec 30, 2024
55b289c
add direction
weiihann Dec 30, 2024
ed7e188
fix tests
weiihann Dec 30, 2024
541ac7f
add more tests
weiihann Dec 30, 2024
4df58b1
use IsBitSetFromMSB
weiihann Dec 30, 2024
e9ef3fd
use IsBitSetFromMSB
weiihann Dec 30, 2024
a6260bd
Replace LSBsFromMSB to LSBs
weiihann Dec 30, 2024
f26404d
change IsBitSetFromMSB to IsBitSet
weiihann Dec 30, 2024
782818f
minor chore
weiihann Dec 30, 2024
223ee99
add SetBit()
weiihann Dec 31, 2024
6e849ce
rename methods
weiihann Dec 31, 2024
d2a871b
Add Cmp()
weiihann Jan 7, 2025
633949c
remove truncateToLength from Bytes()
weiihann Jan 17, 2025
7300340
optimize LSBsFromLSB()
weiihann Jan 17, 2025
3bacfe1
error check for UnmarshalBinary
weiihann Jan 17, 2025
9a6ec8b
minor chore
weiihann Jan 17, 2025
7cce625
Bytes() return fixed array
weiihann Jan 17, 2025
9e0a1b7
remove n == 0 switch case
weiihann Jan 17, 2025
0982320
chore on Append()
weiihann Jan 17, 2025
8b52e43
Minor change on LSH
weiihann Jan 17, 2025
5b00523
deal with different length in SetBytes
weiihann Jan 17, 2025
faf3592
Revert "Minor change on LSH"
weiihann Jan 17, 2025
3b25373
fix LSH bug
weiihann Jan 17, 2025
ff85f15
fix UnmarshalBinary bug
weiihann Jan 17, 2025
2e8467d
fix bug, add tests for SetBytes
weiihann Jan 17, 2025
d132b86
add AppendBit()
weiihann Jan 19, 2025
8144937
add Subset()
weiihann Jan 20, 2025
12516e9
comments
weiihann Jan 20, 2025
e89c610
fix AppendBit bug
weiihann Jan 21, 2025
8f22ebd
add AppendZeros
weiihann Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove n == 0 switch case
weiihann committed Jan 23, 2025
commit 9e0a1b7ef5942ad47064eb434d5d068c5ee8d5da
2 changes: 0 additions & 2 deletions core/trie/bitarray.go
Original file line number Diff line number Diff line change
@@ -275,8 +275,6 @@ func (b *BitArray) Lsh(x *BitArray, n uint8) *BitArray {
}

switch {
case n == 0:
return b
case n >= 192:
b.lsh192(x)
n -= 192