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:
@ -14,7 +14,7 @@ mut:
|
||||
struct Transition {
|
||||
mut:
|
||||
to string
|
||||
condition_handler ConditionFn = voidptr(0)
|
||||
condition_handler ConditionFn = unsafe { nil }
|
||||
}
|
||||
|
||||
pub struct StateMachine {
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user