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

all: wrap up unsafe { nil } (p. 3)

This commit is contained in:
Alexander Medvednikov
2022-07-21 21:01:30 +03:00
parent a68d03ac59
commit 9099594a49
51 changed files with 86 additions and 86 deletions

View File

@ -14,7 +14,7 @@ mut:
struct Transition {
mut:
to string
condition_handler ConditionFn = voidptr(0)
condition_handler ConditionFn = unsafe { nil }
}
pub struct StateMachine {

View File

@ -87,14 +87,14 @@ pub fn (mut list LinkedList<T>) pop() ?T {
if unsafe { node.next == 0 } {
// first node case
// set to null
list.head = voidptr(0)
list.head = unsafe { nil }
} else {
for unsafe { node.next.next != 0 } {
node = node.next
}
to_return = node.next.data
// set to null
node.next = voidptr(0)
node.next = unsafe { nil }
}
list.len -= 1
return to_return