From 6fb00fd9ee87b5c4c751e6569245ecbf60d7e939 Mon Sep 17 00:00:00 2001
From: Joscha Schmiedt <joscha@schmiedt.dev>
Date: Sun, 15 Sep 2024 21:11:19 +0200
Subject: [PATCH] Fix minor compiler warnings

---
 include/linkahead/connection.h | 2 +-
 src/linkahead/result_table.cpp | 6 ++----
 src/linkahead/utility.cpp      | 3 +--
 test/test_entity.cpp           | 4 ++--
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/include/linkahead/connection.h b/include/linkahead/connection.h
index 086821c..f3c5564 100644
--- a/include/linkahead/connection.h
+++ b/include/linkahead/connection.h
@@ -173,7 +173,7 @@ private:
 
   static ConnectionManager mInstance;
 
-  inline ConnectionManager() {};
+  ConnectionManager() = default;
 
   auto mHasConnection(const std::string &name) const -> bool;
 
diff --git a/src/linkahead/result_table.cpp b/src/linkahead/result_table.cpp
index 0653f03..65283e3 100644
--- a/src/linkahead/result_table.cpp
+++ b/src/linkahead/result_table.cpp
@@ -104,8 +104,7 @@ auto ResultTable::GetRows() const noexcept -> RowIterator { return RowIterator(t
 ResultTable::RowIterator::RowIterator(const ResultTable *result_table_param, int index)
   : current_index(index), result_table(result_table_param) {}
 
-ResultTable::RowIterator::RowIterator(const RowIterator &other)
-  : current_index(other.current_index), result_table(other.result_table) {}
+ResultTable::RowIterator::RowIterator(const RowIterator &other) = default;
 
 auto ResultTable::RowIterator::size() const noexcept -> int {
   return this->result_table->delegate->wrapped->data_rows_size();
@@ -143,8 +142,7 @@ auto ResultTable::GetHeader() const noexcept -> HeaderIterator { return HeaderIt
 ResultTable::HeaderIterator::HeaderIterator(const ResultTable *result_table_param, int index)
   : current_index(index), result_table(result_table_param) {}
 
-ResultTable::HeaderIterator::HeaderIterator(const HeaderIterator &other)
-  : current_index(other.current_index), result_table(other.result_table) {}
+ResultTable::HeaderIterator::HeaderIterator(const HeaderIterator &other) = default;
 
 auto ResultTable::HeaderIterator::size() const noexcept -> int {
   return this->result_table->delegate->wrapped->header().columns_size();
diff --git a/src/linkahead/utility.cpp b/src/linkahead/utility.cpp
index 4fabfbc..f15e539 100644
--- a/src/linkahead/utility.cpp
+++ b/src/linkahead/utility.cpp
@@ -128,9 +128,8 @@ auto _load_json_file(const path &json_file) -> value {
   stream.exceptions(std::ios_base::badbit);
 
   stream_parser parser;
-  auto result = std::string();
   auto buffer = std::string(buffer_size, '\0');
-  while (stream.read(&buffer[0], buffer_size)) {
+  while (stream.read(buffer.data(), buffer_size)) {
     parser.write(buffer.c_str(), stream.gcount());
   }
   parser.write(buffer.c_str(), stream.gcount());
diff --git a/test/test_entity.cpp b/test/test_entity.cpp
index b521bd8..857e662 100644
--- a/test/test_entity.cpp
+++ b/test/test_entity.cpp
@@ -737,11 +737,11 @@ TEST(test_entity, test_remove_property) {
   entity.AppendProperty(property10);
   ASSERT_EQ(entity.GetProperties().size(), 9);
 
-  std::cout << "[" << std::endl;
+  std::cout << "[" << "\n";
   for (int i = 0; i < 9; i++) {
     std::cout << "  " << entity.GetProperties().at(i).GetName() << ",\n";
   }
-  std::cout << "]" << std::endl;
+  std::cout << "]" << "\n";
 
   for (int i = 0; i < 3; i++) {
     auto name = "PROPERTY-" + std::to_string(i);
-- 
GitLab