mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-12 22:40:54 +01:00
Bluetooth (Windows): simplifies code
This commit is contained in:
1 parent
5b10cde59f
commit
958e7dbd8f
2 files changed
+6
-2
No files matched your search
@@ -13,6 +13,11 @@ static inline void ffStrbufInitWSV(FFstrbuf* result, const std::wstring_view sou
|
||||
return ffStrbufInitNWS(result, (uint32_t) source.size(), source.data());
|
||||
}
|
||||
|
||||
static inline FFstrbuf ffStrbufCreateWSV(const std::wstring_view source)
|
||||
{
|
||||
return ffStrbufCreateNWS((uint32_t) source.size(), source.data());
|
||||
}
|
||||
|
||||
static inline void ffStrbufSetWSV(FFstrbuf* result, const std::wstring_view source)
|
||||
{
|
||||
return ffStrbufSetNWS(result, (uint32_t) source.size(), source.data());
|
||||
|
||||
@@ -79,8 +79,7 @@ const char* ffBluetoothDetectBattery(FFlist* devices)
|
||||
batt = data.get<uint8_t>();
|
||||
else
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY addr; // MAC address without colon
|
||||
ffStrbufInitWSV(&addr, data.get<std::wstring_view>());
|
||||
FF_STRBUF_AUTO_DESTROY addr = ffStrbufCreateWSV(data.get<std::wstring_view>()); // MAC address without colon
|
||||
if (__builtin_expect(addr.length != 12, 0))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in new issue
Block a user