diff --git a/include/nlohmann/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp index bba61abea..c4b097903 100644 --- a/include/nlohmann/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -64,11 +64,7 @@ class file_input_adapter std::char_traits::int_type get_character() noexcept { - if (JSON_HEDLEY_LIKELY(m_file != nullptr)) - { - return std::fgetc(m_file); - } - return std::char_traits::eof(); // LCOV_EXCL_LINE + return std::fgetc(m_file); } private: diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 9c6dbb6b0..271ff635e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -5951,11 +5951,7 @@ class file_input_adapter std::char_traits::int_type get_character() noexcept { - if (JSON_HEDLEY_LIKELY(m_file != nullptr)) - { - return std::fgetc(m_file); - } - return std::char_traits::eof(); // LCOV_EXCL_LINE + return std::fgetc(m_file); } private: