mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 08:00:34 +01:00
2006-01-31 Robert Love <rml@novell.com>
* src/NetworkManagerAP.c: Optimize the function nm_ap_has_manufacturer_default_essid(). I did not like its resulting machine code. This is the first in a series of code tweaks aiming to generate better machine code and make NetworkManager all the better. Just kidding. Who has time to go through the assembly generated for every function? I certainly don't. I have a wife, a kid, a job, a mortgage, a mistress. But this function was so bad, I was called to arms. Like the book. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1418 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
7c7fa335f2
commit
f30946e156
2 changed files with 17 additions and 5 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,3 +1,14 @@
|
|||
2006-01-31 Robert Love <rml@novell.com>
|
||||
|
||||
* src/NetworkManagerAP.c: Optimize the function
|
||||
nm_ap_has_manufacturer_default_essid(). I did not like its resulting
|
||||
machine code. This is the first in a series of code tweaks aiming to
|
||||
generate better machine code and make NetworkManager all the better.
|
||||
Just kidding. Who has time to go through the assembly generated for
|
||||
every function? I certainly don't. I have a wife, a kid, a job,
|
||||
a mortgage, a mistress. But this function was so bad, I was called
|
||||
to arms. Like the book.
|
||||
|
||||
2006-01-31 Robert Love <rml@novell.com>
|
||||
|
||||
* src/nm-device-802-11-wireless.c: Set "scan_ssid 1" if the requested
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct NMAccessPoint
|
|||
};
|
||||
|
||||
/* This is a controlled list. Want to add to it? Stop. Ask first. */
|
||||
static char* default_essid_list[] =
|
||||
static const char * default_essid_list[] =
|
||||
{
|
||||
"linksys",
|
||||
"default",
|
||||
|
|
@ -522,14 +522,15 @@ void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list)
|
|||
|
||||
gboolean nm_ap_has_manufacturer_default_essid (NMAccessPoint *ap)
|
||||
{
|
||||
int i;
|
||||
const char **default_essid = default_essid_list;
|
||||
const char *this_essid;
|
||||
|
||||
g_return_val_if_fail (ap != NULL, FALSE);
|
||||
this_essid = ap->essid;
|
||||
|
||||
for (i = 0; default_essid_list[i] != NULL; i++)
|
||||
while (*default_essid)
|
||||
{
|
||||
char *essid = default_essid_list[i];
|
||||
if (strcmp (essid, ap->essid) == 0)
|
||||
if (!strcmp (*(default_essid++), this_essid))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue