Skip to content

Commit aefa6a3

Browse files
committed
Refactor Update and Get structures in core.hpp
- Remove unnecessary blank lines in the Update struct for cleaner code. - Change _defaultValue type from SHVar to OwnedVar in the Get struct for better memory management. - Update the assignment of _defaultValue to use direct assignment instead of cloneVar for improved clarity.
1 parent a2cc10a commit aefa6a3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

shards/modules/core/core.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1613,10 +1613,9 @@ struct Update : public SetUpdateBase {
16131613
}
16141614

16151615
const_cast<Shard *>(data.shard)->inlineShardId = InlineShard::CoreSetUpdateRegular;
1616-
1616+
16171617
// just a variable, keep unchanged!
1618-
_exposedInfo =
1619-
ExposedInfo(ExposedInfo::Variable(_name.c_str(), SHCCSTR("The updated table."), type->exposedType, true));
1618+
_exposedInfo = ExposedInfo(ExposedInfo::Variable(_name.c_str(), SHCCSTR("The updated table."), type->exposedType, true));
16201619
}
16211620

16221621
// always lift this limit in a Set/Update
@@ -1675,7 +1674,7 @@ struct Update : public SetUpdateBase {
16751674
};
16761675

16771676
struct Get : public VariableBase {
1678-
SHVar _defaultValue{};
1677+
OwnedVar _defaultValue{};
16791678
SHTypeInfo _defaultType{};
16801679
std::vector<SHTypeInfo> _tableTypes{};
16811680
std::vector<SHVar> _tableKeys{}; // should be fine not to be OwnedVar
@@ -1693,7 +1692,7 @@ struct Get : public VariableBase {
16931692
if (index < variableParamsInfoLen)
16941693
VariableBase::setParam(index, value);
16951694
else if (index == variableParamsInfoLen + 0) {
1696-
cloneVar(_defaultValue, value);
1695+
_defaultValue = value;
16971696
}
16981697
}
16991698

0 commit comments

Comments
 (0)