Jacek Caban (@jacek) commented about dlls/vbscript/interp.c:
+ return TRUE; + default: + return FALSE; + } +} + static HRESULT assign_value(exec_ctx_t *ctx, VARIANT *dst, VARIANT *src, WORD flags) { VARIANT value; HRESULT hres;
+ if (is_simple_variant(src) && is_simple_variant(dst)) + { + *dst = *src; + return S_OK; + } It is a bit of a tradeoff, since for "non-simple" types we would make things slower. I'm not sure what makes the difference so noticeable. The type validation performed by `VariantCopy` and `VariantClear` should have overhead similar to your helper.
I see that, with the current code, we have an extra `VariantClear` call on the `value` variable (inside `VariantCopyInd`), which we need only for `VT_DISPATCH` handling. Would it help if we tried harder to do that only for `VT_DISPATCH`, and otherwise used `VariantCopyInd` directly into the destination? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10541#note_139234