From b102dfee4b797a8d872b7e48727733c92dff0137 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 2 Sep 2020 11:25:13 +0200 Subject: [PATCH] minor improvements --- requester.cpp | 8 ++------ requester.hpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/requester.cpp b/requester.cpp index 60858e9..5a80f9c 100644 --- a/requester.cpp +++ b/requester.cpp @@ -31,9 +31,7 @@ requester::requester() { } requester::~requester() { - if (_h) { - curl_easy_cleanup(_h); - } + curl_easy_cleanup(_h); } requester::requester(requester&& other) { @@ -43,9 +41,7 @@ requester::requester(requester&& other) { requester& requester::operator=(requester &&other) { if (this != &other) { - if (_h) { - curl_easy_cleanup(_h); - } + curl_easy_cleanup(_h); _h = other._h; other._h = nullptr; } diff --git a/requester.hpp b/requester.hpp index a58d479..50769c7 100644 --- a/requester.hpp +++ b/requester.hpp @@ -34,7 +34,7 @@ class requester { std::string get(const std::string& url); private: - CURL* _h; // curl handle + CURL* _h {nullptr}; // curl handle }; #endif // _requester_H_