Skip to content

Commit 80c70d5

Browse files
committed
use std::any_of
1 parent cfe9672 commit 80c70d5

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

source/module_lr/potentials/xc_kernel.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,8 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
3737

3838
// -----------------------------------------------------------------------------------
3939
// for GGA
40-
const bool is_gga = [&funcs]()
41-
{
42-
for (xc_func_type& func : funcs)
43-
{
44-
switch (func.info->family)
45-
{
46-
case XC_FAMILY_GGA:
47-
case XC_FAMILY_HYB_GGA:
48-
return true;
49-
}
50-
}
51-
return false;
52-
}();
40+
const bool is_gga = std::any_of(funcs.begin(), funcs.end(), [](const xc_func_type& f) { f.info->family == XC_FAMILY_GGA || f.info->family == XC_FAMILY_HYB_GGA; });
41+
5342
std::vector<std::vector<ModuleBase::Vector3<double>>> gradrho; // \nabla \rho
5443
std::vector<double> sigma; // |\nabla\rho|^2
5544
std::vector<double> sgn; // sgn for threshold mask

0 commit comments

Comments
 (0)