Commit 6c1eb31
smb/client: reduce loop count in map_smb2_to_linux_error() by half
The smb2_error_map_table array currently has 1743 elements. When searching
for the last element and calling smb2_print_status(), 3486 comparisons
are needed.
The loop in smb2_print_status() is unnecessary, smb2_print_status() can be
removed, and only iterate over the array once, printing the message when
the target status code is found.
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>1 parent 7ad7859 commit 6c1eb31
1 file changed
Lines changed: 6 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2418 | 2418 | | |
2419 | 2419 | | |
2420 | 2420 | | |
2421 | | - | |
2422 | | - | |
2423 | | - | |
2424 | | - | |
2425 | | - | |
2426 | | - | |
2427 | | - | |
2428 | | - | |
2429 | | - | |
2430 | | - | |
2431 | | - | |
2432 | | - | |
2433 | | - | |
2434 | | - | |
2435 | | - | |
2436 | | - | |
2437 | | - | |
2438 | | - | |
2439 | 2421 | | |
2440 | 2422 | | |
2441 | 2423 | | |
| |||
2452 | 2434 | | |
2453 | 2435 | | |
2454 | 2436 | | |
2455 | | - | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
2459 | | - | |
2460 | | - | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
2461 | 2440 | | |
2462 | 2441 | | |
2463 | 2442 | | |
2464 | 2443 | | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
2465 | 2447 | | |
2466 | 2448 | | |
2467 | 2449 | | |
| |||
0 commit comments