1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: remove switch_statement()

This commit is contained in:
Alexander Medvednikov
2019-10-27 13:03:40 +03:00
parent e890f682e2
commit 9c5abd575f
2 changed files with 8 additions and 78 deletions

View File

@@ -104,17 +104,19 @@ fn test_hamming() {
mut input1 := bitfield.new(len)
mut input2 := bitfield.new(len)
for i := 0; i < len; i++ {
switch rand.next(4) {
case 0:
case 1:
match rand.next(4) {
0, 1 {
input1.setbit(i)
count++
case 2:
}
2 {
input2.setbit(i)
count++
case 3:
}
3 {
input1.setbit(i)
input2.setbit(i)
}
}
}
assert count == bitfield.hamming(input1, input2)