@@ -216,7 +216,7 @@ Result RestGraphHandler::edgeSetsAction(Graph& graph) {
216
216
}
217
217
218
218
Result RestGraphHandler::edgeSetAction (Graph& graph,
219
- const std::string& edgeDefinitionName) {
219
+ std::string const & edgeDefinitionName) {
220
220
switch (request ()->requestType ()) {
221
221
case RequestType::POST:
222
222
return edgeActionCreate (graph, edgeDefinitionName);
@@ -230,7 +230,7 @@ Result RestGraphHandler::edgeSetAction(Graph& graph,
230
230
}
231
231
232
232
Result RestGraphHandler::vertexSetAction (
233
- Graph& graph, const std::string& vertexCollectionName) {
233
+ Graph& graph, std::string const & vertexCollectionName) {
234
234
switch (request ()->requestType ()) {
235
235
case RequestType::POST:
236
236
return vertexActionCreate (graph, vertexCollectionName);
@@ -243,8 +243,8 @@ Result RestGraphHandler::vertexSetAction(
243
243
}
244
244
245
245
Result RestGraphHandler::vertexAction (Graph& graph,
246
- const std::string& vertexCollectionName,
247
- const std::string& vertexKey) {
246
+ std::string const & vertexCollectionName,
247
+ std::string const & vertexKey) {
248
248
switch (request ()->requestType ()) {
249
249
case RequestType::GET: {
250
250
vertexActionRead (graph, vertexCollectionName, vertexKey);
@@ -262,8 +262,8 @@ Result RestGraphHandler::vertexAction(Graph& graph,
262
262
}
263
263
264
264
Result RestGraphHandler::edgeAction (Graph& graph,
265
- const std::string& edgeDefinitionName,
266
- const std::string& edgeKey) {
265
+ std::string const & edgeDefinitionName,
266
+ std::string const & edgeKey) {
267
267
switch (request ()->requestType ()) {
268
268
case RequestType::GET:
269
269
edgeActionRead (graph, edgeDefinitionName, edgeKey);
@@ -552,8 +552,8 @@ void RestGraphHandler::generateResultMergedWithObject(
552
552
553
553
// TODO this is nearly exactly the same as vertexActionRead. reuse somehow?
554
554
void RestGraphHandler::edgeActionRead (Graph& graph,
555
- const std::string& definitionName,
556
- const std::string& key) {
555
+ std::string const & definitionName,
556
+ std::string const & key) {
557
557
// check for an etag
558
558
bool isValidRevision;
559
559
RevisionId ifNoneRid = extractRevision (" if-none-match" , isValidRevision);
@@ -586,12 +586,13 @@ void RestGraphHandler::edgeActionRead(Graph& graph,
586
586
}
587
587
588
588
std::unique_ptr<Graph> RestGraphHandler::getGraph (
589
- const std::string& graphName) {
589
+ std::string const & graphName) {
590
590
auto graphResult = _graphManager.lookupGraphByName (graphName);
591
591
if (graphResult.fail ()) {
592
592
THROW_ARANGO_EXCEPTION (std::move (graphResult).result ());
593
593
}
594
594
TRI_ASSERT (graphResult.get () != nullptr );
595
+ // cppcheck-suppress returnStdMoveLocal
595
596
return std::move (graphResult.get ());
596
597
}
597
598
@@ -601,8 +602,8 @@ std::unique_ptr<Graph> RestGraphHandler::getGraph(
601
602
// contains the old value in the field "old". This is not documented in
602
603
// HTTP/Gharial!
603
604
Result RestGraphHandler::edgeActionRemove (Graph& graph,
604
- const std::string& definitionName,
605
- const std::string& key) {
605
+ std::string const & definitionName,
606
+ std::string const & key) {
606
607
bool waitForSync =
607
608
_request->parsedValue (StaticStrings::WaitForSyncString, false );
608
609
@@ -639,65 +640,65 @@ void RestGraphHandler::addEtagHeader(velocypack::Slice rev) {
639
640
}
640
641
641
642
Result RestGraphHandler::vertexActionUpdate (graph::Graph& graph,
642
- const std::string& collectionName,
643
- const std::string& key) {
643
+ std::string const & collectionName,
644
+ std::string const & key) {
644
645
return vertexModify (graph, collectionName, key, true );
645
646
}
646
647
647
648
Result RestGraphHandler::vertexActionReplace (graph::Graph& graph,
648
- const std::string& collectionName,
649
- const std::string& key) {
649
+ std::string const & collectionName,
650
+ std::string const & key) {
650
651
return vertexModify (graph, collectionName, key, false );
651
652
}
652
653
653
654
Result RestGraphHandler::vertexActionCreate (graph::Graph& graph,
654
- const std::string& collectionName) {
655
+ std::string const & collectionName) {
655
656
return vertexCreate (graph, collectionName);
656
657
}
657
658
658
659
Result RestGraphHandler::edgeActionUpdate (graph::Graph& graph,
659
- const std::string& collectionName,
660
- const std::string& key) {
660
+ std::string const & collectionName,
661
+ std::string const & key) {
661
662
return edgeModify (graph, collectionName, key, true );
662
663
}
663
664
664
665
Result RestGraphHandler::edgeActionReplace (graph::Graph& graph,
665
- const std::string& collectionName,
666
- const std::string& key) {
666
+ std::string const & collectionName,
667
+ std::string const & key) {
667
668
return edgeModify (graph, collectionName, key, false );
668
669
}
669
670
670
671
Result RestGraphHandler::edgeModify (graph::Graph& graph,
671
- const std::string& collectionName,
672
- const std::string& key, bool isPatch) {
672
+ std::string const & collectionName,
673
+ std::string const & key, bool isPatch) {
673
674
return documentModify (graph, collectionName, key, isPatch, TRI_COL_TYPE_EDGE);
674
675
}
675
676
676
677
Result RestGraphHandler::edgeCreate (graph::Graph& graph,
677
- const std::string& collectionName) {
678
+ std::string const & collectionName) {
678
679
return documentCreate (graph, collectionName, TRI_COL_TYPE_EDGE);
679
680
}
680
681
681
682
Result RestGraphHandler::edgeActionCreate (graph::Graph& graph,
682
- const std::string& collectionName) {
683
+ std::string const & collectionName) {
683
684
return edgeCreate (graph, collectionName);
684
685
}
685
686
686
687
Result RestGraphHandler::vertexModify (graph::Graph& graph,
687
- const std::string& collectionName,
688
- const std::string& key, bool isPatch) {
688
+ std::string const & collectionName,
689
+ std::string const & key, bool isPatch) {
689
690
return documentModify (graph, collectionName, key, isPatch,
690
691
TRI_COL_TYPE_DOCUMENT);
691
692
}
692
693
693
694
Result RestGraphHandler::vertexCreate (graph::Graph& graph,
694
- const std::string& collectionName) {
695
+ std::string const & collectionName) {
695
696
return documentCreate (graph, collectionName, TRI_COL_TYPE_DOCUMENT);
696
697
}
697
698
698
699
// /_api/gharial/{graph-name}/edge/{definition-name}
699
700
Result RestGraphHandler::editEdgeDefinition (
700
- graph::Graph& graph, const std::string& edgeDefinitionName) {
701
+ graph::Graph& graph, std::string const & edgeDefinitionName) {
701
702
return modifyEdgeDefinition (graph, EdgeDefinitionAction::EDIT,
702
703
edgeDefinitionName);
703
704
}
@@ -819,7 +820,7 @@ Result RestGraphHandler::modifyVertexDefinition(
819
820
return Result ();
820
821
}
821
822
Result RestGraphHandler::removeEdgeDefinition (
822
- graph::Graph& graph, const std::string& edgeDefinitionName) {
823
+ graph::Graph& graph, std::string const & edgeDefinitionName) {
823
824
return modifyEdgeDefinition (graph, EdgeDefinitionAction::REMOVE,
5CE
824
825
edgeDefinitionName);
825
826
}
@@ -831,8 +832,8 @@ Result RestGraphHandler::removeEdgeDefinition(
831
832
// TODO the document API also supports mergeObjects, silent and ignoreRevs;
832
833
// should gharial, too?
833
834
Result RestGraphHandler::documentModify (graph::Graph& graph,
834
- const std::string& collectionName,
835
- const std::string& key, bool isPatch,
835
+ std::string const & collectionName,
836
+ std::string const & key, bool isPatch,
836
837
TRI_col_type_e colType) {
837
838
bool parseSuccess = false ;
838
839
VPackSlice body = this ->parseVPackBody (parseSuccess);
@@ -950,8 +951,8 @@ Result RestGraphHandler::documentCreate(graph::Graph& graph,
950
951
}
951
952
952
953
Result RestGraphHandler::vertexActionRemove (graph::Graph& graph,
953
- const std::string& collectionName,
954
- const std::string& key) {
954
+ std::string const & collectionName,
955
+ std::string const & key) {
955
956
bool waitForSync =
956
957
_request->parsedValue (StaticStrings::WaitForSyncString, false );
957
958
0 commit comments