comparison pidgin/gtkstatusbox.c @ 28817:e35043e96a1a

break early if we found the right saved status, and rewrote the exit logic of the outer loop to be slightly more clear
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 25 Oct 2009 22:18:08 +0000
parents 6e1a582ae629
children 2c1677e123dc
comparison
equal deleted inserted replaced
28803:6e703969157d 28817:e35043e96a1a
2451 PurpleSavedStatusSub *sub = purple_savedstatus_get_substatus(ss, acct); 2451 PurpleSavedStatusSub *sub = purple_savedstatus_get_substatus(ss, acct);
2452 if (sub) { 2452 if (sub) {
2453 const PurpleStatusType *sub_type = purple_savedstatus_substatus_get_type(sub); 2453 const PurpleStatusType *sub_type = purple_savedstatus_substatus_get_type(sub);
2454 const char *subtype_status_id = purple_status_type_get_id(sub_type); 2454 const char *subtype_status_id = purple_status_type_get_id(sub_type);
2455 if (subtype_status_id && !strcmp(subtype_status_id, 2455 if (subtype_status_id && !strcmp(subtype_status_id,
2456 purple_status_type_get_id(acct_status_type))) 2456 purple_status_type_get_id(acct_status_type))) {
2457 found = TRUE; 2457 found = TRUE;
2458 break;
2459 }
2458 } 2460 }
2459 } 2461 }
2460 if (!found) 2462
2461 continue; 2463 if (found) {
2462 saved_status = ss; 2464 saved_status = ss;
2463 break; 2465 break;
2466 }
2464 } 2467 }
2465 } 2468 }
2466 2469
2467 g_list_free(active_accts); 2470 g_list_free(active_accts);
2468 2471