l_audio: less code

why is this so hard for my brain? :S
This commit is contained in:
Nevyn Bengtsson 2021-01-19 13:24:32 +01:00 committed by Bjorn
parent 7f5e46ad0b
commit 84bfac984c
1 changed files with 1 additions and 2 deletions

View File

@ -89,7 +89,6 @@ static int l_lovrAudioGetDevices(lua_State *L) {
int listOfDevicesIdx = lua_gettop(L);
for(int i = 0; i < devices->length; i++) {
AudioDevice *device = &devices->data[i];
lua_pushinteger(L, i+1); // key in listOfDevicesIdx, for the bottom settable
lua_newtable(L);
luax_pushenum(L, AudioType, device->type);
lua_setfield(L, -2, "type");
@ -98,7 +97,7 @@ static int l_lovrAudioGetDevices(lua_State *L) {
lua_pushboolean(L, device->isDefault);
lua_setfield(L, -2, "isDefault");
lua_settable(L, listOfDevicesIdx);
lua_rawseti(L, listOfDevicesIdx, i + 1);
}
lovrAudioFreeDevices(devices);
return 1;