Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var candidates = ListOfTransitions.init();
- var last: *ListOfTransitions.Node = undefined;
- var first = false;
- for (transitions) |t| {
- if(std.mem.eql(u8, t.from, ev.name)) {
- var node = try candidates.createNode(t, allocator);
- if(first) {
- candidates.insertAfter(last, node);
- } else {
- candidates.prepend(node);
- first = true;
- last = node;
- }
- }
- }
- var it = candidates.first;
- while (it) |node| : (it = node.next) {
- candidates.destroyNode(node, allocator);
- }
Advertisement
Add Comment
Please, Sign In to add comment