File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939
4040#include " srreal_converters.hpp"
4141#include " srreal_pickling.hpp"
42+ #include " srreal_validators.hpp"
4243
4344#include < diffpy/srreal/PairQuantity.hpp>
4445
@@ -488,13 +489,13 @@ void set_pair_mask(PairQuantity& obj,
488489 python::object others)
489490{
490491 if (!others.is_none ()) mask_all_pairs (obj, others);
491- python::extract<int > geti (i);
492- python::extract<int > getj (j);
493492 bool mask = msk;
494- // short circuit for normal call
495- if (geti. check ( ) && getj. check ( ))
493+ // short circuit for normal call with scalar values
494+ if (! isiterable (i ) && ! isiterable (j ))
496495 {
497- obj.setPairMask (geti (), getj (), mask);
496+ const int i1 = extractint (i);
497+ const int j1 = extractint (j);
498+ obj.setPairMask (i1, j1, mask);
498499 return ;
499500 }
500501 std::vector<int > iindices = parsepairindex (i);
You can’t perform that action at this time.
0 commit comments