代码拉取完成,页面将自动刷新
代码文件:archive_read_support_format_mtree.rs
问题代码函数:bid_keyword
重构前
switch (*p) {
case 'c': keys = keys_c; break;
case 'd': case 'f': keys = keys_df; break;
case 'g': keys = keys_g; break;
case 'i': case 'l': keys = keys_il; break;
case 'm': keys = keys_m; break;
case 'n': case 'o': keys = keys_no; break;
case 'r': keys = keys_r; break;
case 's': keys = keys_s; break;
case 't': keys = keys_t; break;
case 'u': keys = keys_u; break;
default: return (0);/* Unknown key */
}
重构后
unsafe {
match *p as i32 {
99 => {
keys = keys_c.as_ptr()
/* Unknown key */
}
100 | 102 => keys = keys_df.as_ptr(),
103 => keys = keys_g.as_ptr(),
105 | 108 => keys = keys_il.as_ptr(),
109 => keys = keys_m.as_ptr(),
110 | 111 => keys = keys_no.as_ptr(),
114 => keys = keys_r.as_ptr(),
115 => keys = keys_s.as_ptr(),
116 => keys = keys_t.as_ptr(),
117 => keys = keys_u.as_ptr(),
_ => return 0,
}
}
重构前的字母是关键字的首字母,重构后难以理解
Hi han_hui_hui, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Base-service, and any of the maintainers: @hexiaowen , @zhujianwei001 , @谢志鹏 , @Monday , @Sora5175 , @Kevin , @lcynju , @huangduirong
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
代码文件:archive_read_support_format_mtree.rs
问题代码函数:parse_keyword
重构后很难阅读,类似问题建议仔细排查一遍
为漏改的部分,新提交的pr已解决:!93:解决部分Issue提到的问题
登录 后才可以发表评论