diff --git a/database.h b/database.h index 40ae4f9..cce3f6d 100644 --- a/database.h +++ b/database.h @@ -14,6 +14,10 @@ #include "dateNtime.h" #endif // !DNT_H //linked list +#ifndef linkely +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#endif typedef struct linkedlist{ struct linkedlist* next; struct linkedlist* prev; @@ -125,7 +129,7 @@ bool is_admin(char* role){ } char line[100]; while(fgets(line,100,fp) != NULL){ - if(line[0] == '#') continue; + if(unlikely(line[0] == '#')) continue; while(line[strlen(line)-1] == '\n' || (int)line[strlen(line)-1] == 13) line[strlen(line)-1] = '\0';