From 7f020f3f44660fdd6eb9fc16ba5a609c97b88f0d Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Tue, 7 Jan 2020 22:27:13 +0900 Subject: [PATCH] refactor: remove error prefix that will automatically be added in format_underline --- toml/get.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toml/get.hpp b/toml/get.hpp index ea2a2cf..e34502c 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -476,7 +476,7 @@ find(const basic_value& v, const std::size_t idx) if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); } @@ -490,7 +490,7 @@ basic_value& find(basic_value& v, const std::size_t idx) if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); } @@ -500,11 +500,11 @@ template class M, template class V> basic_value find(basic_value&& v, const std::size_t idx) { - typename basic_value::array_type ary = std::move(v).as_array(); + auto& ary = v.as_array(); if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); } @@ -573,7 +573,7 @@ find(const basic_value& v, const std::size_t idx) if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); } @@ -588,7 +588,7 @@ find(basic_value& v, const std::size_t idx) if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); } @@ -603,7 +603,7 @@ find(basic_value&& v, const std::size_t idx) if(ary.size() <= idx) { throw std::out_of_range(detail::format_underline(concat_to_string( - "[error] index ", idx, " is out of range"), { + "index ", idx, " is out of range"), { {std::addressof(detail::get_region(v)), "in this array"} })); }