Skip to content

Commit 8fee140

Browse files
committed
builtin: small cleanup in string_interpolation.v
1 parent 5cb2683 commit 8fee140

File tree

1 file changed

+13
-48
lines changed

1 file changed

+13
-48
lines changed

vlib/builtin/string_interpolation.v

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
module builtin
2+
3+
import strconv
4+
import strings
5+
16
/*=============================================================================
27
Copyright (c) 2019-2021 Dario Deledda. All rights reserved.
38
Use of this source code is governed by an MIT license
@@ -6,11 +11,6 @@ that can be found in the LICENSE file.
611
This file contains string interpolation V functions
712
=============================================================================*/
813

9-
module builtin
10-
11-
import strconv
12-
import strings
13-
1414
//=============================================================================
1515
// Enum format types max 0x1F => 32 types
1616
//=============================================================================
@@ -60,35 +60,6 @@ pub fn (x StrIntpType) str() string {
6060
}
6161
}
6262

63-
/*
64-
pub fn (x StrIntpType) data_str() string {
65-
match x {
66-
.si_no_str{ return "no_str" }
67-
.si_c { return "d_c" }
68-
69-
.si_u8 { return "d_u8" }
70-
.si_i8 { return "d_i8" }
71-
.si_u16 { return "d_u16" }
72-
.si_i16 { return "d_i16" }
73-
.si_u32 { return "d_u32" }
74-
.si_i32 { return "d_i32" }
75-
.si_u64 { return "d_u64" }
76-
.si_i64 { return "d_i64" }
77-
78-
.si_f32 { return "d_f32" }
79-
.si_f64 { return "d_f64" }
80-
.si_g32 { return "d_f32" } // g32 format use f32 data
81-
.si_g64 { return "d_f64" } // g64 format use f64 data
82-
.si_e32 { return "d_f32" } // e32 format use f32 data
83-
.si_e64 { return "d_f64" } // e64 format use f64 data
84-
85-
.si_s { return "d_s" }
86-
.si_p { return "d_p" }
87-
.si_vp { return "d_vp" }
88-
}
89-
}
90-
*/
91-
9263
//=============================================================================
9364
// Union data
9465
//=============================================================================
@@ -110,25 +81,19 @@ pub mut:
11081
d_vp voidptr
11182
}
11283

113-
fn fabs64(x f64) f64 {
114-
if x < 0 {
115-
return -x
116-
}
117-
return x
84+
[inline]
85+
fn fabs32(x f32) f32 {
86+
return if x < 0 { -x } else { x }
11887
}
11988

120-
fn fabs32(x f32) f32 {
121-
if x < 0 {
122-
return -x
123-
}
124-
return x
89+
[inline]
90+
fn fabs64(x f64) f64 {
91+
return if x < 0 { -x } else { x }
12592
}
12693

94+
[inline]
12795
fn abs64(x i64) u64 {
128-
if x < 0 {
129-
return u64(-x)
130-
}
131-
return u64(x)
96+
return if x < 0 { u64(-x) } else { u64(x) }
13297
}
13398

13499
//=========================================

0 commit comments

Comments
 (0)