Skip to content

Commit

Permalink
Tweaks to reduce code size.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Oct 9, 2023
1 parent 4ed31a3 commit fa9a7b4
Show file tree
Hide file tree
Showing 6 changed files with 2,007 additions and 1,990 deletions.
44 changes: 26 additions & 18 deletions Source/CesiumRuntime/Private/CesiumMetadataValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ FString UCesiumMetadataValueBlueprintLibrary::GetString(

FCesiumPropertyArray UCesiumMetadataValueBlueprintLibrary::GetArray(
UPARAM(ref) const FCesiumMetadataValue& Value) {
return FCesiumPropertyArray();
//return mpark::visit(
// [](auto value) -> FCesiumPropertyArray {
// if constexpr (CesiumGltf::IsMetadataArray<decltype(value)>::value) {
// return FCesiumPropertyArray(value);
// }
// return FCesiumPropertyArray();
// },
// Value._value);
return mpark::visit(
[](auto value) -> FCesiumPropertyArray {
if constexpr (CesiumGltf::IsMetadataArray<decltype(value)>::value) {
return FCesiumPropertyArray(value);
}
return FCesiumPropertyArray();
},
Value._value);
}

bool UCesiumMetadataValueBlueprintLibrary::IsEmpty(
Expand All @@ -153,12 +152,21 @@ template <typename TTo>
/*static*/ TTo FCesiumMetadataValue::convertTo(
const ValueType& Value,
const TTo& DefaultValue) noexcept {
return DefaultValue;
//return mpark::visit(
// [DefaultValue](auto value) {
// return CesiumMetadataConversions<TTo, decltype(value)>::convert(
// value,
// DefaultValue);
// },
// Value);
}
return mpark::visit(
[DefaultValue](auto value) {
return CesiumMetadataConversions<TTo, decltype(value)>::convert(
value,
DefaultValue);
},
Value);
}

FCesiumMetadataValue& FCesiumMetadataValue::operator=(
const FCesiumMetadataValue& rhs) noexcept = default;
FCesiumMetadataValue&
FCesiumMetadataValue::operator=(FCesiumMetadataValue&& rhs) noexcept = default;
FCesiumMetadataValue::FCesiumMetadataValue(
const FCesiumMetadataValue& rhs) noexcept = default;
FCesiumMetadataValue::FCesiumMetadataValue(
FCesiumMetadataValue&& rhs) noexcept = default;
FCesiumMetadataValue ::~FCesiumMetadataValue() noexcept = default;
Loading

0 comments on commit fa9a7b4

Please sign in to comment.