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