Global: major FFlist related code refactor

This commit is contained in:
李通洲
2023-04-21 22:41:32 +08:00
parent 6d002c175f
commit 39582471e8
14 changed files with 43 additions and 37 deletions
+1 -4
View File
@@ -37,8 +37,7 @@ void ffPrintBluetooth(FFinstance* instance, FFBluetoothOptions* options)
return;
}
FFlist filtered;
ffListInit(&filtered, sizeof(FFBluetoothDevice*));
FF_LIST_AUTO_DESTROY filtered = ffListCreate(sizeof(FFBluetoothDevice*));
FF_LIST_FOR_EACH(FFBluetoothDevice, device, bluetooth->devices)
{
@@ -59,8 +58,6 @@ void ffPrintBluetooth(FFinstance* instance, FFBluetoothOptions* options)
uint8_t index = (uint8_t) (filtered.length == 1 ? 0 : i + 1);
printDevice(instance, options, *(FFBluetoothDevice**)ffListGet(&filtered, i), index);
}
ffListDestroy(&filtered);
}
void ffInitBluetoothOptions(FFBluetoothOptions* options)