forked from Hay1tsme/segatools
vfs: strlen optimization
This commit is contained in:
@ -352,6 +352,8 @@ void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename)
|
||||
cfg->redirections_to[i],
|
||||
_countof(cfg->redirections_to[i]),
|
||||
filename);
|
||||
|
||||
cfg->redirections_from_len[i] = (int)wcslen(cfg->redirections_from[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ static HRESULT vfs_custom_path_hook(
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
if (path_compare_w(src, from, wcslen(from)) != 0) {
|
||||
if (path_compare_w(src, from, vfs_config.redirections_from_len[i]) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ struct vfs_config {
|
||||
wchar_t appdata[MAX_PATH];
|
||||
wchar_t option[MAX_PATH];
|
||||
wchar_t redirections_from[MAX_REDIRECTIONS][MAX_PATH];
|
||||
int redirections_from_len[MAX_REDIRECTIONS];
|
||||
wchar_t redirections_to[MAX_REDIRECTIONS][MAX_PATH];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user