Skip to content

Commit

Permalink
Undo trivially constructable std::move removals
Browse files Browse the repository at this point in the history
  • Loading branch information
azrogers committed Dec 20, 2024
1 parent 182ee0b commit 869a432
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ CheckOptions:
value: "true"
- key: misc-include-cleaner.IgnoreHeaders
value: ".*cesium-async\\+\\+\\.h;.*bits\/.*.h"
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: "false"
HeaderFilterRegex: ".*"
HeaderFileExtensions: ["h"]
ExcludeHeaderFilterRegex: ".*\\.ezvcpkg\/.*"
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesContent/src/I3dmToGltfConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ CesiumAsync::Future<ConvertedI3dm> convertI3dmContent(
decodedInstances.rotations.begin(),
[](auto&& upOct, auto&& rightOct) {
return rotationFromUpRight(
decodeOct32P(reinterpret_cast<const uint16_t*>(upOct)),
decodeOct32P(reinterpret_cast<const uint16_t*>(rightOct)));
decodeOct32P(upOct),
decodeOct32P(rightOct));
});
} else if (decodedInstances.rotationENU) {
glm::dmat4 worldTransform = assetFetcher.tileTransform;
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesContent/src/PntsToGltfConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ void decodeDracoMetadata(

const auto& dracoMetadataSemantics = parsedContent.dracoMetadataSemantics;
for (const auto& dracoMetadataSemantic : dracoMetadataSemantics) {
DracoMetadataSemantic dracoSemantic = dracoMetadataSemantic.second;
const DracoMetadataSemantic& dracoSemantic = dracoMetadataSemantic.second;
draco::PointAttribute* pAttribute =
pPointCloud->attribute(dracoSemantic.dracoId);
if (!validateDracoMetadataAttribute(pAttribute, dracoSemantic)) {
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesContent/src/SubtreeAvailability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ std::optional<SubtreeAvailability::AvailabilityView> parseAvailabilityView(
subtree.buffers,
subtree.bufferViews);
if (maybeAvailability) {
contentAvailability.emplace_back(*maybeAvailability);
contentAvailability.emplace_back(std::move(*maybeAvailability));
}
}

Expand Down
6 changes: 3 additions & 3 deletions Cesium3DTilesSelection/src/ImplicitQuadtreeLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ CesiumAsync::Future<TileLoadResult> requestTileContent(
[ellipsoid,
pLogger,
tileUrl,
pAssetAccessor,
pAssetAccessor = std::move(pAssetAccessor),
pCompletedRequest](GltfConverterResult&& result) mutable {
// Report any errors if there are any
logTileLoadResult(pLogger, tileUrl, result.errors);
if (result.errors || !result.model) {
return TileLoadResult::createFailedResult(
pAssetAccessor,
std::move(pAssetAccessor),
std::move(pCompletedRequest));
}

Expand All @@ -231,7 +231,7 @@ CesiumAsync::Future<TileLoadResult> requestTileContent(
std::nullopt,
std::nullopt,
std::nullopt,
pAssetAccessor,
std::move(pAssetAccessor),
std::move(pCompletedRequest),
{},
TileLoadResultState::Success,
Expand Down
8 changes: 4 additions & 4 deletions Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ LayerJsonTerrainLoader::loadTileContent(const TileLoadInput& loadInput) {
return std::move(finalFuture)
.thenInMainThread([this,
asyncSystem,
pAssetAccessor,
pAssetAccessor = std::move(pAssetAccessor),
ellipsoid,
&currentLayer,
&tile,
Expand All @@ -919,7 +919,7 @@ LayerJsonTerrainLoader::loadTileContent(const TileLoadInput& loadInput) {
// thread based on the projection of the loader since the upsampler
// needs this UV to do the upsampling
auto finalResult = convertToTileLoadResult(
pAssetAccessor,
std::move(pAssetAccessor),
std::move(loadResult),
ellipsoid);
bool doesTileHaveUpsampledChild = tileHasUpsampledChild(tile);
Expand All @@ -946,7 +946,7 @@ LayerJsonTerrainLoader::loadTileContent(const TileLoadInput& loadInput) {
bool doesTileHaveUpsampledChild = tileHasUpsampledChild(tile);
return std::move(futureQuantizedMesh)
.thenImmediately(
[pAssetAccessor,
[pAssetAccessor = std::move(pAssetAccessor),
doesTileHaveUpsampledChild,
projection = this->_projection,
tileTransform = tile.getTransform(),
Expand All @@ -957,7 +957,7 @@ LayerJsonTerrainLoader::loadTileContent(const TileLoadInput& loadInput) {
// based on the projection of the loader since the upsampler needs
// this UV to do the upsampling
auto result = convertToTileLoadResult(
pAssetAccessor,
std::move(pAssetAccessor),
std::move(loadResult),
ellipsoid);
if (doesTileHaveUpsampledChild &&
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesSelection/src/TilesetHeightQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ void TilesetHeightQuery::intersectVisibleTile(

// Set ray info to this hit if closer, or the first hit
if (!this->intersection.has_value()) {
this->intersection = gltfIntersectResult.hit;
this->intersection = std::move(gltfIntersectResult.hit);
} else {
double prevDistSq = this->intersection->rayToWorldPointDistanceSq;
double thisDistSq = intersection->rayToWorldPointDistanceSq;
if (thisDistSq < prevDistSq)
this->intersection = gltfIntersectResult.hit;
this->intersection = std::move(gltfIntersectResult.hit);
}
}

Expand Down
12 changes: 6 additions & 6 deletions Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,21 +996,21 @@ TilesetJsonLoader::loadTileContent(const TileLoadInput& loadInput) {
upAxis,
tileUrl,
pAssetAccessor = std::move(pAssetAccessor),
pCompletedRequest](GltfConverterResult&& result) {
pCompletedRequest = std::move(pCompletedRequest)](GltfConverterResult&& result) {
logTileLoadResult(pLogger, tileUrl, result.errors);
if (result.errors) {
return TileLoadResult::createFailedResult(
pAssetAccessor,
pCompletedRequest);
std::move(pAssetAccessor),
std::move(pCompletedRequest));
}
return TileLoadResult{
std::move(*result.model),
upAxis,
std::nullopt,
std::nullopt,
std::nullopt,
pAssetAccessor,
pCompletedRequest,
std::move(pAssetAccessor),
std::move(pCompletedRequest),
{},
TileLoadResultState::Success,
ellipsoid};
Expand All @@ -1023,7 +1023,7 @@ TilesetJsonLoader::loadTileContent(const TileLoadInput& loadInput) {
upAxis,
tileRefine,
pLogger,
pAssetAccessor,
std::move(pAssetAccessor),
std::move(pCompletedRequest),
std::move(externalContentInitializer),
ellipsoid));
Expand Down
12 changes: 6 additions & 6 deletions CesiumGltfContent/src/GltfUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1522,9 +1522,9 @@ GltfUtilities::IntersectResult GltfUtilities::intersectRayGltfModel(

if (!result.hit.has_value()) {
result.hit = RayGltfHit{
*primitiveHitPoint,
primitiveToWorld,
worldPoint,
std::move(*primitiveHitPoint),
std::move(primitiveToWorld),
std::move(worldPoint),
rayToWorldPointDistanceSq,
meshId,
primitiveId};
Expand All @@ -1533,9 +1533,9 @@ GltfUtilities::IntersectResult GltfUtilities::intersectRayGltfModel(

// Use in result if it's closer
if (rayToWorldPointDistanceSq < result.hit->rayToWorldPointDistanceSq) {
result.hit->primitivePoint = *primitiveHitPoint;
result.hit->primitiveToWorld = primitiveToWorld;
result.hit->worldPoint = worldPoint;
result.hit->primitivePoint = std::move(*primitiveHitPoint);
result.hit->primitiveToWorld = std::move(primitiveToWorld);
result.hit->worldPoint = std::move(worldPoint);
result.hit->rayToWorldPointDistanceSq = rayToWorldPointDistanceSq;
result.hit->meshId = meshId;
result.hit->primitiveId = primitiveId;
Expand Down
4 changes: 2 additions & 2 deletions CesiumRasterOverlays/src/RasterOverlayUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,8 +1108,8 @@ bool upsamplePrimitiveForRasterOverlays(
Accessor& accessor =
model.accessors[static_cast<size_t>(attribute.accessorIndex)];
accessor.count = numberOfVertices;
accessor.min = attribute.minimums;
accessor.max = attribute.maximums;
accessor.min = std::move(attribute.minimums);
accessor.max = std::move(attribute.maximums);
}

// Add an accessor for the indices
Expand Down
8 changes: 4 additions & 4 deletions CesiumRasterOverlays/src/WebMapServiceRasterOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ WebMapServiceRasterOverlay::createTileProvider(
if (!pResponse) {
return nonstd::make_unexpected(RasterOverlayLoadFailureDetails{
RasterOverlayLoadType::TileProvider,
pRequest,
std::move(pRequest),
"No response received from web map service."});
}

Expand All @@ -332,15 +332,15 @@ WebMapServiceRasterOverlay::createTileProvider(
if (error != tinyxml2::XMLError::XML_SUCCESS) {
return nonstd::make_unexpected(RasterOverlayLoadFailureDetails{
RasterOverlayLoadType::TileProvider,
pRequest,
std::move(pRequest),
"Could not parse web map service XML."});
}

tinyxml2::XMLElement* pRoot = doc.RootElement();
if (!pRoot) {
return nonstd::make_unexpected(RasterOverlayLoadFailureDetails{
RasterOverlayLoadType::TileProvider,
pRequest,
std::move(pRequest),
"Web map service XML document does not have a root "
"element."});
}
Expand All @@ -349,7 +349,7 @@ WebMapServiceRasterOverlay::createTileProvider(
if (!validateCapabilities(pRoot, options, validationError)) {
return nonstd::make_unexpected(RasterOverlayLoadFailureDetails{
RasterOverlayLoadType::TileProvider,
pRequest,
std::move(pRequest),
validationError});
}

Expand Down

0 comments on commit 869a432

Please sign in to comment.