From 89223df3863c1ad55825e2cb4ca99bf2e2ddc9c0 Mon Sep 17 00:00:00 2001 From: Sermet Pekin Date: Wed, 6 Nov 2024 11:26:27 +0300 Subject: [PATCH] refactor --- extern/dotenv/dotenv.h | 8 +++++--- include/dataframe.h | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extern/dotenv/dotenv.h b/extern/dotenv/dotenv.h index 7356d1f..f51ba16 100644 --- a/extern/dotenv/dotenv.h +++ b/extern/dotenv/dotenv.h @@ -85,13 +85,15 @@ class dotenv void load(const std::string &filepath) { std::ifstream file(filepath); - if (!file) + + if (!file) { - std::cerr << "Could not open " << filepath << " file" << std::endl; + std::cerr << "Could not find " << filepath << " file" << std::endl; return; } std::string line; + while (std::getline(file, line)) { line = trim(line); @@ -100,7 +102,7 @@ class dotenv size_t delimiterPos = line.find('='); if (delimiterPos == std::string::npos) - continue; // Skip if no '=' is found + continue; std::string key = trim(line.substr(0, delimiterPos)); std::string value = trim(line.substr(delimiterPos + 1)); diff --git a/include/dataframe.h b/include/dataframe.h index f0e7620..75c8ea3 100644 --- a/include/dataframe.h +++ b/include/dataframe.h @@ -52,7 +52,6 @@ namespace evds { class DataFrame; - void save_as_csv(const DataFrame &df, const std::string &filename, std::optional delimiter = std::nullopt) ; using Cell = std::variant;