From 1533b77404a84e17cefb14e9b15b5aca6a342300 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 20 Apr 2022 19:47:09 +0100 Subject: [PATCH] builtin: remove unnecessary casts for defunct small unsigned warning (#14108) --- vlib/builtin/js/map_test.js.v | 4 ++-- vlib/builtin/map_test.v | 4 ++-- vlib/builtin/string.v | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/builtin/js/map_test.js.v b/vlib/builtin/js/map_test.js.v index e066115275..a71730e7cf 100644 --- a/vlib/builtin/js/map_test.js.v +++ b/vlib/builtin/js/map_test.js.v @@ -775,7 +775,7 @@ fn test_byte_keys() { m[i]++ assert m[i] == i + 1 } - assert m.len == int(byte_max) + assert m.len == byte_max keys := m.keys() for i in u8(0) .. byte_max { assert keys[i] == i @@ -827,7 +827,7 @@ fn test_u16_keys() { m[i]++ assert m[i] == i + 1 } - assert m.len == int(end) + assert m.len == end keys := m.keys() for i in u16(0) .. end { assert keys[i] == i diff --git a/vlib/builtin/map_test.v b/vlib/builtin/map_test.v index 223a4f8995..5fb57a1ccc 100644 --- a/vlib/builtin/map_test.v +++ b/vlib/builtin/map_test.v @@ -763,7 +763,7 @@ fn test_byte_keys() { m[i]++ assert m[i] == i + 1 } - assert m.len == int(byte_max) + assert m.len == byte_max keys := m.keys() for i in u8(0) .. byte_max { assert keys[i] == i @@ -815,7 +815,7 @@ fn test_u16_keys() { m[i]++ assert m[i] == i + 1 } - assert m.len == int(end) + assert m.len == end keys := m.keys() for i in u16(0) .. end { assert keys[i] == i diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index f471aa5050..eec1194638 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -1937,7 +1937,7 @@ pub fn (name string) match_glob(pattern string) bool { mut is_inverted := false mut inner_match := false mut inner_idx := bstart + 1 - mut inner_c := u8(0) + mut inner_c := 0 if inner_idx < plen { inner_c = pattern[inner_idx] if inner_c == `^` {