v2 / vlib / v / gen / c / testdata / string_concat_chain_optimization.vv
12 lines · 10 sloc · 266 bytes · 359e28da67a7838094265af74be8570743b046d6
Raw
1fn join_three(a string, b string, c string) string {
2 return a + b + c
3}
4
5fn join_four(a string, b string, c string, d string) string {
6 return a + b + c + d
7}
8
9fn main() {
10 assert join_three('a', 'b', 'c') == 'abc'
11 assert join_four('a', 'b', 'c', 'd') == 'abcd'
12}
13