Commit 2555906f authored by Qianqiang Liu's avatar Qianqiang Liu Committed by Helge Deller

fbcon: break earlier in search_fb_in_map and search_for_mapped_con

Break the for loop immediately upon finding the target, making the
process more efficient.
Signed-off-by: default avatarQianqiang Liu <qianqiang.liu@163.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent f1ebbe4c
...@@ -512,8 +512,10 @@ static int search_fb_in_map(int idx) ...@@ -512,8 +512,10 @@ static int search_fb_in_map(int idx)
int i, retval = 0; int i, retval = 0;
for (i = first_fb_vc; i <= last_fb_vc; i++) { for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] == idx) if (con2fb_map[i] == idx) {
retval = 1; retval = 1;
break;
}
} }
return retval; return retval;
} }
...@@ -523,8 +525,10 @@ static int search_for_mapped_con(void) ...@@ -523,8 +525,10 @@ static int search_for_mapped_con(void)
int i, retval = 0; int i, retval = 0;
for (i = first_fb_vc; i <= last_fb_vc; i++) { for (i = first_fb_vc; i <= last_fb_vc; i++) {
if (con2fb_map[i] != -1) if (con2fb_map[i] != -1) {
retval = 1; retval = 1;
break;
}
} }
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment