style: add braces to if and remove additional else

This commit is contained in:
ToruNiina 2019-02-19 02:55:31 +09:00
parent 321364c7c2
commit 83bf83b6dd

View File

@ -29,8 +29,9 @@ inline void resize_impl(T& container, std::size_t N, std::true_type)
template<typename T>
inline void resize_impl(T& container, std::size_t N, std::false_type)
{
if(container.size() >= N) return;
else throw std::invalid_argument("not resizable type");
if(container.size() >= N) {return;}
throw std::invalid_argument("not resizable type");
}
} // detail
@ -38,8 +39,9 @@ inline void resize_impl(T& container, std::size_t N, std::false_type)
template<typename T>
inline void resize(T& container, std::size_t N)
{
if(container.size() == N) return;
else return detail::resize_impl(container, N, detail::has_resize_method<T>());
if(container.size() == N) {return;}
return detail::resize_impl(container, N, detail::has_resize_method<T>());
}
namespace detail
@ -73,7 +75,5 @@ T from_string(const std::string& str, U&& opt)
return v;
}
}// toml
#endif // TOML11_UTILITY