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

native: replace abs() with mathutils.abs() (#18568)

This commit is contained in:
Eliyaan (Nopana) 2023-06-27 00:25:12 +02:00 committed by GitHub
parent a67342d05b
commit 7a9c885b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -451,10 +451,6 @@ fn (mut c Amd64) cset(op Amd64SetOp) {
c.g.println('set${op} al')
}
fn abs(a i64) i64 {
return if a < 0 { -a } else { a }
}
fn (mut c Amd64) tmp_jle(addr i64) {
// Calculate the relative offset to jump to
// (`addr` is absolute address)

View File

@ -590,7 +590,7 @@ fn (mut g Gen) write_string_with_padding(s string, max int) {
}
fn (g &Gen) abs_to_rel_addr(addr i64) int {
return int(abs(addr - g.buf.len)) - 1
return int(mu.abs(addr - g.buf.len)) - 1
}
fn (mut g Gen) try_var_offset(var_name string) int {