mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 06:00:08 +01:00
Global: optimises usage of FFstrbuf and FFlist
This commit is contained in:
@@ -75,7 +75,7 @@ const char* ffDetectDNS(FFDNSOptions* options, FFlist* results)
|
||||
// Handle different DNS management services
|
||||
if (results->length == 1)
|
||||
{
|
||||
const FFstrbuf* firstEntry = FF_LIST_GET(FFstrbuf, *results, 0);
|
||||
const FFstrbuf* firstEntry = FF_LIST_FIRST(FFstrbuf, *results);
|
||||
|
||||
if (ffStrbufEqualS(firstEntry, "127.0.0.53"))
|
||||
{
|
||||
|
||||
@@ -462,7 +462,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
|
||||
appendIpv4(options, &item->ipv4, ifa);
|
||||
else if (adapter->ipv4.length > 0)
|
||||
{
|
||||
appendIpv4(options, &item->ipv4, *FF_LIST_GET(struct ifaddrs*, adapter->ipv4, 0));
|
||||
appendIpv4(options, &item->ipv4, *FF_LIST_FIRST(struct ifaddrs*, adapter->ipv4));
|
||||
FF_DEBUG("Using first IPv4 address for interface %s", adapter->mac->ifa_name);
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
|
||||
appendIpv6(options, &item->ipv6, selected);
|
||||
else if (adapter->ipv6.length > 0)
|
||||
{
|
||||
appendIpv6(options, &item->ipv6, *FF_LIST_GET(struct ifaddrs*, adapter->ipv6, 0));
|
||||
appendIpv6(options, &item->ipv6, *FF_LIST_FIRST(struct ifaddrs*, adapter->ipv6));
|
||||
FF_DEBUG("Using first IPv6 address for interface %s", adapter->mac->ifa_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ static uint32_t getAMUser(void)
|
||||
if (instance.state.platform.configDirs.length == 0) return 0;
|
||||
|
||||
// check if $XDG_CONFIG_HOME/appman/appman-config exists
|
||||
FFstrbuf* baseDir = FF_LIST_GET(FFstrbuf, instance.state.platform.configDirs, 0);
|
||||
FFstrbuf* baseDir = FF_LIST_FIRST(FFstrbuf, instance.state.platform.configDirs);
|
||||
uint32_t baseLen = baseDir->length;
|
||||
ffStrbufAppendS(baseDir, "appman/appman-config");
|
||||
FF_STRBUF_AUTO_DESTROY packagesPath = ffStrbufCreate();
|
||||
|
||||
Reference in New Issue
Block a user