From a4f7f3320fae1252fc600ab6d3a9a1b0eadb19d1 Mon Sep 17 00:00:00 2001 From: Julian Mundhahs Date: Mon, 16 Dec 2024 11:52:41 +0100 Subject: [PATCH] apply sonarcloud suggestion --- src/index/DeltaTriples.cpp | 8 ++++---- src/index/DeltaTriples.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/index/DeltaTriples.cpp b/src/index/DeltaTriples.cpp index de0764a0d6..23776adfa9 100644 --- a/src/index/DeltaTriples.cpp +++ b/src/index/DeltaTriples.cpp @@ -200,10 +200,10 @@ void to_json(nlohmann::json& j, const DeltaTriplesCount& count) { } // ____________________________________________________________________________ -DeltaTriplesCount DeltaTriplesCount::operator-( - const DeltaTriplesCount& other) const { - return {triplesInserted_ - other.triplesInserted_, - triplesDeleted_ - other.triplesDeleted_}; +DeltaTriplesCount operator-(const DeltaTriplesCount& lhs, + const DeltaTriplesCount& rhs) { + return {lhs.triplesInserted_ - rhs.triplesInserted_, + lhs.triplesDeleted_ - rhs.triplesDeleted_}; } // ____________________________________________________________________________ diff --git a/src/index/DeltaTriples.h b/src/index/DeltaTriples.h index 91dac7f237..4c63cef01c 100644 --- a/src/index/DeltaTriples.h +++ b/src/index/DeltaTriples.h @@ -47,7 +47,8 @@ struct DeltaTriplesCount { /// library to allow for implicit conversion. friend void to_json(nlohmann::json& j, const DeltaTriplesCount& count); - DeltaTriplesCount operator-(const DeltaTriplesCount& other) const; + friend DeltaTriplesCount operator-(const DeltaTriplesCount& lhs, + const DeltaTriplesCount& rhs); }; // A class for maintaining triples that are inserted or deleted after index