Skip to content
Snippets Groups Projects
Commit 3c4f61af authored by rswindell's avatar rswindell
Browse files

Optimize set_qwk_flag() - no need to read/modify/write the user database if

the flag is already set.
parent a1d106cf
Branches
Tags
No related merge requests found
...@@ -63,6 +63,9 @@ bool route_circ(char *via, char *id) ...@@ -63,6 +63,9 @@ bool route_circ(char *via, char *id)
{ {
char str[256],*p,*sp; char str[256],*p,*sp;
if(via==NULL || id==NULL)
return(false);
SAFECOPY(str,via); SAFECOPY(str,via);
p=str; p=str;
SKIP_WHITESPACE(p); SKIP_WHITESPACE(p);
...@@ -985,13 +988,12 @@ int sbbs_t::set_qwk_flag(ulong flag) ...@@ -985,13 +988,12 @@ int sbbs_t::set_qwk_flag(ulong flag)
int i; int i;
char str[32]; char str[32];
if(useron.qwk&flag)
return 0;
if((i=getuserrec(&cfg,useron.number,U_QWK,8,str))!=0) if((i=getuserrec(&cfg,useron.number,U_QWK,8,str))!=0)
return(i); return(i);
useron.qwk=ahtoul(str); useron.qwk=ahtoul(str);
useron.qwk|=flag; useron.qwk|=flag;
if((i=putuserrec(&cfg,useron.number,U_QWK,8,ultoa(useron.qwk,str,16)))!=0) return putuserrec(&cfg,useron.number,U_QWK,8,ultoa(useron.qwk,str,16));
return(i);
return(0);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment