opt: optimize code struct

This commit is contained in:
DreamMaoMao 2025-09-28 21:12:16 +08:00
parent 365854ccf6
commit a06552b670
3 changed files with 5 additions and 4 deletions

View file

@ -391,9 +391,9 @@ int parse_circle_direction(const char *str) {
// 根据转换后的小写字符串返回对应的枚举值
if (strcmp(lowerStr, "next") == 0) {
return 1;
return NEXT;
} else {
return -1;
return PREV;
}
}

View file

@ -78,7 +78,7 @@ void exchange_stack_client(const Arg *arg) {
Client *tc;
if (!c || c->isfloating || c->isfullscreen || c->ismaxmizescreen)
return;
if (arg->i > 0) {
if (arg->i == NEXT) {
tc = get_next_stack_client(c, false);
} else {
tc = get_next_stack_client(c, true);
@ -194,7 +194,7 @@ focusstack(const Arg *arg) {
if (!sel || sel->isfullscreen)
return;
if (arg->i > 0) {
if (arg->i == NEXT) {
tc = get_next_stack_client(sel, false);
} else {
tc = get_next_stack_client(sel, true);

View file

@ -164,6 +164,7 @@ enum {
enum { UP, DOWN, LEFT, RIGHT, UNDIR }; /* smartmovewin */
enum { NONE, OPEN, MOVE, CLOSE, TAG };
enum { UNFOLD, FOLD, INVALIDFOLD };
enum { PREV, NEXT };
typedef struct Pertag Pertag;
typedef struct Monitor Monitor;