Skip to content

Commit b486e39

Browse files
committed
refactor(core): 简化Variant类setProperty方法实现
- 移除不必要的变量声明直接在函数调用中使用NO_CONST_V宏 - 保持原有功能不变但减少临时变量的创建 - 提高代码简洁性和可读性
1 parent 1c75efe commit b486e39

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/variant.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ Variant Variant::getProperty(zend_string *prop_name) const {
340340
}
341341

342342
void Variant::setProperty(zend_string *prop_name, const Variant &value) const {
343-
auto zv = NO_CONST_V(value);
344-
zend_update_property_ex(ce(), object(), prop_name, zv);
343+
zend_update_property_ex(ce(), object(), prop_name, NO_CONST_V(value));
345344
}
346345

347346
Variant Variant::getProperty(const Variant &name) const {

0 commit comments

Comments
 (0)