mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
tools: make v test-cleancode
test everything by default (#10050)
This commit is contained in:
parent
cba2cb6b9c
commit
8a380f4699
132 changed files with 3230 additions and 3440 deletions
|
@ -10,9 +10,9 @@ module subtle
|
|||
// corresponding) index. The memory beyond the slice length is ignored.
|
||||
pub fn any_overlap(x []byte, y []byte) bool {
|
||||
// NOTE: Remember to come back to this (joe-c)
|
||||
return x.len > 0 && y.len > 0 && // &x.data[0] <= &y.data[y.len-1] &&
|
||||
return x.len > 0 && y.len > 0 && // &x.data[0] <= &y.data[y.len-1] &&
|
||||
// &y.data[0] <= &x.data[x.len-1]
|
||||
unsafe {&x[0] <= &y[y.len - 1] && &y[0] <= &x[x.len - 1]}
|
||||
unsafe { &x[0] <= &y[y.len - 1] && &y[0] <= &x[x.len - 1] }
|
||||
}
|
||||
|
||||
// inexact_overlap reports whether x and y share memory at any non-corresponding
|
||||
|
@ -22,7 +22,7 @@ pub fn any_overlap(x []byte, y []byte) bool {
|
|||
// inexact_overlap can be used to implement the requirements of the crypto/cipher
|
||||
// AEAD, Block, BlockMode and Stream interfaces.
|
||||
pub fn inexact_overlap(x []byte, y []byte) bool {
|
||||
if x.len == 0 || y.len == 0 || unsafe {&x[0] == &y[0]} {
|
||||
if x.len == 0 || y.len == 0 || unsafe { &x[0] == &y[0] } {
|
||||
return false
|
||||
}
|
||||
return any_overlap(x, y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue