History

lua: simplify further

As suggested by avih. Obviously this was unnecessarily convoluted.

wm4 committed 6 years ago

Commit 8a58a691 parent d375cc31 file · +1 −8Browse files

Unified · Split

player/lua.c+1−8
@@ -504,17 +504,10 @@ static int script_wait_event(lua_State *L) · 503 unmodified lines
504504
505505 mpv_event *event = mpv_wait_event(ctx->client, luaL_optnumber(L, 1, 1e20));
506506
507− lua_newtable(L); // event
508−
509507 struct mpv_node rn;
510508 mpv_event_to_node(&rn, event);
511509
512− assert(rn.format == MPV_FORMAT_NODE_MAP);
513− mpv_node_list *list = rn.u.list;
514− for (int n = 0; n < list->num; n++) {
515− pushnode(L, &list->values[n]);
516− lua_setfield(L, -2, list->keys[n]);
517− }
510+ pushnode(L, &rn); // event
518511
519512 mpv_free_node_contents(&rn);
520513

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t