Skip to content

Commit 6d377eb

Browse files
committed
fix: v programs
1 parent 454238f commit 6d377eb

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

.github/odin.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ sudo apt-get install -y aria2
66
mkdir /tmp/odin
77
cd /tmp/odin
88
aria2c -c -o $FILE_NAME https://github.com/odin-lang/Odin/releases/download/$VERSION/$FILE_NAME
9+
if test -d ubuntu_artifacts; then rm -r ubuntu_artifacts; fi
910
unzip -o $FILE_NAME
10-
sudo chmod +x $PWD/ubuntu_artifacts/odin
11-
sudo ln -sf $PWD/ubuntu_artifacts/odin /usr/bin/odin
11+
if test -d ubuntu_artifacts; then ODIN_BIN_PATH=$PWD/ubuntu_artifacts/odin; else ODIN_BIN_PATH=$PWD/odin; fi
12+
sudo chmod +x $ODIN_BIN_PATH
13+
sudo ln -sf $ODIN_BIN_PATH /usr/bin/odin
1214
odin version

bench/algorithm/lru/1.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mut:
2525
m map[u32]u32
2626
}
2727

28-
fn (mut lru LRU) get(key u32) ?u32 {
28+
fn (mut lru LRU) get(key u32) !u32 {
2929
v := lru.m[key] or { return error('not found') }
3030
lru.m.delete(key)
3131
lru.m[key] = v

bench/algorithm/regex-redux/1.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import regex
55

66
fn main() {
77
file_name := os.args[1] or { '25000_in' }
8-
mut content := os.read_file(file_name)?
8+
mut content := os.read_file(file_name)!
99
ilen := content.len
10-
mut replace_re := regex.regex_opt('(>.*\n)|(\n)')?
10+
mut replace_re := regex.regex_opt('(>.*\n)|(\n)')!
1111
content = replace_re.replace(content, '')
1212
clen := content.len
1313
for p in [
@@ -30,14 +30,14 @@ fn main() {
3030
'<[^>]*>': '|'
3131
'\\|[^|][^|]*\\|': '-'
3232
} {
33-
mut re := regex.regex_opt(p)?
33+
mut re := regex.regex_opt(p)!
3434
content = re.replace(content, r)
3535
}
3636
println('\n${ilen}\n${clen}\n${content.len}')
3737
}
3838

39-
fn var_find(content string, pattern string) ?int {
40-
mut re := regex.regex_opt(normalize_pattern(pattern))?
39+
fn var_find(content string, pattern string) !int {
40+
mut re := regex.regex_opt(normalize_pattern(pattern))!
4141
matches := re.find_all(content)
4242
return matches.len / 2
4343
}

bench/bench_v.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ environments:
6262
- mv app out
6363
out_dir: out
6464
run_cmd: app
65-
allow_failure: true
65+
# allow_failure: true
6666
# - os: linux
6767
# compiler: v+gc+zig
6868
# version: latest

bench/bench_v_autofree.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ problems:
1212
- name: pidigits
1313
source:
1414
- 1.v
15-
- 2.v
15+
# - 2.v
1616
- name: edigits
1717
source:
18-
- 1.v
18+
# - 1.v
1919
- name: fasta
2020
source:
2121
- 1.v
@@ -43,7 +43,7 @@ problems:
4343
- 1.v
4444
- name: http-server
4545
source:
46-
- 1.v
46+
# - 1.v
4747
# - name: regex-redux
4848
# source:
4949
# - 1.v

bench/include/kotlin-jvm/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
// id("org.springframework.boot").version("2.5.6")
1111
// id("io.spring.dependency-management").version("1.0.11.RELEASE")
1212
id("com.github.johnrengelman.shadow").version("7.1.2")
13-
id("com.github.ben-manes.versions").version("0.45.0")
13+
id("com.github.ben-manes.versions").version("0.46.0")
1414
java
1515
application
1616
}
@@ -30,9 +30,9 @@ dependencies {
3030
// implementation(kotlin("stdlib"))
3131
// implementation("org.slf4j:slf4j-api:1.7.36")
3232
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
33-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
34-
implementation("org.jetbrains.kotlinx:atomicfu:0.19.0")
35-
val ktor_version = "2.2.3"
33+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
34+
implementation("org.jetbrains.kotlinx:atomicfu:0.20.0")
35+
val ktor_version = "2.2.4"
3636
implementation("io.ktor:ktor-server-core:$ktor_version")
3737
// implementation("io.ktor:ktor-server-netty:$ktor_version")
3838
implementation("io.ktor:ktor-server-cio:$ktor_version")

bench/include/kotlin-native/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
val kotlinVersion = "1.8.10"
77
kotlin("multiplatform").version(kotlinVersion)
88
kotlin("plugin.serialization").version(kotlinVersion)
9-
id("com.github.ben-manes.versions").version("0.45.0")
9+
id("com.github.ben-manes.versions").version("0.46.0")
1010
}
1111

1212
repositories {
@@ -25,7 +25,7 @@ kotlin {
2525
implementation(libs.kbignum)
2626
// implementation("com.ionspin.kotlin:bignum:0.3.1")
2727
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
28-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
28+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
2929
}
3030
}
3131
}

0 commit comments

Comments
 (0)